Benign crates 9,988,565 installs Download

solana-packet 2.2.1

“The definition of a Solana network packet.”

Rust test marker or harnessimports std::net::IpAddr
SHA-256004f2d2daf407b3ec1a1ca5ec34b3ccdfd6866dd2d3c7d0715004a96e4b6d127

Evidence

English function-word token "the" lines 1–2
1//! The definition of a Solana network packet.
2#![cfg_attr(feature = "frozen-abi", feature(min_speciali …
imports std::net::IpAddr lines 3–29
3:33… auto_cfg))]
4
5#[cfg(feature = "frozen-abi")]
6use solana_frozen_abi_macro::AbiExample;
7#[cfg(feature = "bincode")]
8use {
9 bincode::{Options, Result},
10 std::io::Write,
11};
12use {
13 bitflags::bitflags,
14 std::{
15 fmt,
16 net::{IpAddr, Ipv4Addr, SocketAddr},
17 slice::SliceIndex,
18 },
19};
20#[cfg(feature = "serde")]
21use {
22 serde_derive::{Deserialize, Serialize},
23 serde_with::{serde_as, Bytes},
24};
25
26#[cfg(test)]
27static_assertions::const_assert_eq!(PACKET_DATA_SIZE, 1232);
28/// Maximum over-the-wire size of a Transaction
29/// 1280 is IPv6 …
English function-word token "for" lines 39–42
39:23… de")]
40impl<T: ?Sized + serde::Serialize> Encode for T {
41 fn encode<W: Write>(&self, writer: W) -> Result<()> {
42 bincode::serialize_into:: …
Rust calls a .get() accessor lines 139–141
139:74… m.
140 /// packet.data(..) returns packet.buffer.get(..packet.meta.size).
141 /// Returns None if the index is invalid or if the packet is already ma …
imports super::* lines 311–324
⋯5 lines
316#[cfg(test)]
317mod tests {
318 use super::*;
319
320 #[test]
321 fn test_deserialize_slice() {
322 let p = Packet::from_data(None, u32::MAX).unwrap();
323 assert_eq!(p.deserialize_slice(..).ok(), Some(u32::MAX));
324 assert_eq!(p.deserialize_slice(0..4).ok( …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.