Struct linkspace::prelude::NetPktParts
#[repr(C, align(4))]pub struct NetPktParts<'a> {
pub net_header: NetPktHeader,
/* private fields */
}
Expand description
Rust enum repr of a NetPkt
Fields§
§net_header: NetPktHeader
Implementations§
§impl<'a> NetPktParts<'a>
impl<'a> NetPktParts<'a>
pub fn from_unchecked(
net_header: NetPktHeader,
hash: B64,
pkt_parts: PointParts<'a>
) -> NetPktParts<'a> ⓘ
pub fn from_unchecked( net_header: NetPktHeader, hash: B64, pkt_parts: PointParts<'a> ) -> NetPktParts<'a> ⓘ
The caller must ensure PktHash matches the Pkt
pub fn from(pkt: &'a dyn NetPkt) -> NetPktParts<'a> ⓘ
Methods from Deref<Target = PointParts<'a>>§
Trait Implementations§
§impl<'a> Clone for NetPktParts<'a>
impl<'a> Clone for NetPktParts<'a>
§fn clone(&self) -> NetPktParts<'a> ⓘ
fn clone(&self) -> NetPktParts<'a> ⓘ
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<'a> Debug for NetPktParts<'a>
impl<'a> Debug for NetPktParts<'a>
§impl<'a> Deref for NetPktParts<'a>
impl<'a> Deref for NetPktParts<'a>
§impl<'o> From<NetPktParts<'o>> for NetPktArc
impl<'o> From<NetPktParts<'o>> for NetPktArc
§fn from(value: NetPktParts<'o>) -> NetPktArc ⓘ
fn from(value: NetPktParts<'o>) -> NetPktArc ⓘ
Converts to this type from the input type.
§impl<'a> NetPkt for NetPktParts<'a>
impl<'a> NetPkt for NetPktParts<'a>
fn hash_ref(&self) -> &B64
fn net_header_ref(&self) -> &NetPktHeader
fn byte_segments(&self) -> ByteSegments<'_>
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 net_header_mut(&mut self) -> Option<&mut NetPktHeader>
fn as_netbox(&self) -> Box<NetPktFatPtr>
fn as_netarc(&self) -> NetPktArc ⓘ
§impl<'a> PartialEq for NetPktParts<'a>
impl<'a> PartialEq for NetPktParts<'a>
§fn eq(&self, other: &NetPktParts<'a>) -> bool
fn eq(&self, other: &NetPktParts<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Copy for NetPktParts<'a>
impl<'a> StructuralPartialEq for NetPktParts<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for NetPktParts<'a>
impl<'a> Send for NetPktParts<'a>
impl<'a> Sync for NetPktParts<'a>
impl<'a> Unpin for NetPktParts<'a>
impl<'a> UnwindSafe for NetPktParts<'a>
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