pub struct NetPktArc(/* private fields */);
Expand description
Arc around the byte repr NetPkt
Send + Sync + cheap Clone, super::NetPktHeader is immutable
Implementations§
§impl NetPktArc
impl NetPktArc
pub fn refcount(&self) -> usize
pub fn thin_arc(&self) -> &NetPktArcPtr ⓘ
pub fn into_raw_arc(self) -> *const NetPktArcPtr
pub unsafe fn from_raw_arc(ptr: *const NetPktArcPtr) -> NetPktArc ⓘ
pub unsafe fn from_raw_arc(ptr: *const NetPktArcPtr) -> NetPktArc ⓘ
Safety
must be created through Self::into_raw_arc
Methods from Deref<Target = NetPktArcPtr>§
Methods from Deref<Target = NetPktPtr>§
pub fn as_sized(&self) -> &NetPktFatPtr
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<'de> Deserialize<'de> for NetPktArc
impl<'de> Deserialize<'de> for NetPktArc
§fn deserialize<D>(
deserializer: D
) -> Result<NetPktArc, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<NetPktArc, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§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 NetPkt for NetPktArc
impl NetPkt for NetPktArc
fn hash_ref(&self) -> &B64
fn net_header_ref(&self) -> &NetPktHeader
fn as_netarc(&self) -> NetPktArc ⓘ
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 as_netbox(&self) -> Box<NetPktFatPtr>
fn net_header_mut(&mut self) -> Option<&mut NetPktHeader>
§impl Serialize for NetPktArc
impl Serialize for NetPktArc
§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 NetPktArc
impl Send for NetPktArc
impl Sync for NetPktArc
impl Unpin for NetPktArc
impl UnwindSafe for NetPktArc
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