Struct linkspace::misc::ShareArcPkt
pub struct ShareArcPkt<T>where
T: ?Sized,{
pub arc: OnceCell<NetPktArc>,
pub pkt: T,
}
Expand description
Wrapper around a NetPkt that ensures .as_netarc() is only called once.
Fields§
§arc: OnceCell<NetPktArc>
§pkt: T
Implementations§
pub fn new(pkt: T) -> ShareArcPkt<T> ⓘ
pub fn borrow_arc(&self) -> &NetPktArcPtr ⓘ
Trait Implementations§
§fn clone(&self) -> ShareArcPkt<T> ⓘ
fn clone(&self) -> ShareArcPkt<T> ⓘ
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 morefn hash_ref(&self) -> &B64
§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_ref(&self) -> &NetPktHeader
fn as_netarc(&self) -> NetPktArc ⓘ
fn byte_segments(&self) -> ByteSegments<'_>
fn as_point(&self) -> &dyn Point
fn net_header_mut(&mut self) -> Option<&mut NetPktHeader>
fn as_netbox(&self) -> Box<NetPktFatPtr>
Auto Trait Implementations§
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