#[repr(C, align(4))]pub struct NetPktPtr {
pub net_header: NetPktHeader,
/* private fields */
}
Expand description
Byte repr of a NetPkt
Fields§
§net_header: NetPktHeader
Implementations§
§impl NetPktPtr
impl NetPktPtr
pub fn as_sized(&self) -> &NetPktFatPtr
pub fn as_mut_sized(&mut self) -> &mut NetPktFatPtr
pub unsafe fn from_bytes_unchecked(b: &[u8]) -> &NetPktPtr ⓘ
pub unsafe fn from_bytes_unchecked(b: &[u8]) -> &NetPktPtr ⓘ
Safety
Must be aligned valid netpkt bytes.
pub fn reroute(&self, route: NetPktHeader) -> ReroutePkt<&NetPktPtr> ⓘ
pub fn check(&self, skip_hash: bool) -> Result<(), Error>
pub fn as_netpkt_bytes(&self) -> &[u8] ⓘ
Methods from Deref<Target = PointThinPtr>§
pub fn point_header(&self) -> &PointHeader
pub fn as_sized(&self) -> &PointPtr ⓘ
pub fn internal_consitent_length(&self) -> Result<(), Error>
pub fn internal_consitent_length(&self) -> Result<(), Error>
Check the header length fields and return the point size. This is the length without the hash.
pub fn check_signature(&self) -> Result<(), Error>
Trait Implementations§
§impl NetPkt for NetPktPtr
impl NetPkt for NetPktPtr
fn as_netarc(&self) -> NetPktArc ⓘ
fn net_header_mut(&mut self) -> Option<&mut NetPktHeader>
fn byte_segments(&self) -> ByteSegments<'_>
fn hash_ref(&self) -> &B64
fn net_header_ref(&self) -> &NetPktHeader
fn as_point(&self) -> &dyn Point
§fn recv(&self) -> Option<U64>
fn recv(&self) -> Option<U64>
recv is somewhat special.
It depends on the context. Reading directly from the database it should return the stamp at which it was inserted.
NOTE: Do not rely on this value being unique - in the db or otherwise.
fn as_netbox(&self) -> Box<NetPktFatPtr>
§impl Serialize for NetPktPtr
impl Serialize for NetPktPtr
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for NetPktPtr
impl Send for NetPktPtr
impl Sync for NetPktPtr
impl Unpin for NetPktPtr
impl UnwindSafe for NetPktPtr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
§impl<T> NetPktExt for Twhere
T: NetPkt + ?Sized,
impl<T> NetPktExt for Twhere T: NetPkt + ?Sized,
§fn get_recv(&self) -> U64
fn get_recv(&self) -> U64
see NetPkt::recv
fn hash(&self) -> B64
fn net_header(&self) -> NetPktHeader
fn as_netparts(&self) -> NetPktParts<'_> ⓘwhere Self: Sized,
fn to_default_str(&self) -> String
§impl<T> Point for Twhere
T: NetPktExt,
impl<T> Point for Twhere T: NetPktExt,
fn data(&self) -> &[u8] ⓘ
fn tail(&self) -> Option<Tail<'_>>
§fn padding(&self) -> &[u8] ⓘ
fn padding(&self) -> &[u8] ⓘ
Points are padded with upto 7 \xFF bytes and are u64 aligned - this is accessible here for completeness sake.
§fn linkpoint_header(&self) -> Option<&LinkPointHeader>
fn linkpoint_header(&self) -> Option<&LinkPointHeader>
Return a LinkPointHeader, works for both key and link points.
§fn pkt_segments(&self) -> ByteSegments<'_>
fn pkt_segments(&self) -> ByteSegments<'_>
A utility function to translate this format into bytes for hashing & io