#[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

pub fn as_sized(&self) -> &NetPktFatPtr

pub fn as_mut_sized(&mut self) -> &mut NetPktFatPtr

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>

Check the header length fields and return the point size. This is the length without the hash.

pub fn check_signature(&self) -> Result<(), Error>

pub fn pkt_bytes(&self) -> &[u8]

include padding

Trait Implementations§

§

impl Debug for NetPktPtr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for NetPktPtr

§

type Target = PointThinPtr

The resulting type after dereferencing.
§

fn deref(&self) -> &<NetPktPtr as Deref>::Target

Dereferences the value.
§

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>

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

§

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
§

impl ToOwned for NetPktPtr

§

type Owned = Box<NetPktFatPtr>

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> <NetPktPtr as ToOwned>::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

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,

§

fn get_recv(&self) -> U64

§

fn hash(&self) -> B64

§

fn net_header(&self) -> NetPktHeader

§

fn size(&self) -> u16

Padded size
§

fn as_netparts(&self) -> NetPktParts<'_> where Self: Sized,

§

fn to_default_str(&self) -> String

§

impl<T> Point for Twhere T: NetPktExt,

§

fn parts(&self) -> PointParts<'_>

The rusty enum repr of a point.
§

fn data(&self) -> &[u8]

§

fn tail(&self) -> Option<Tail<'_>>

§

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>

Return a LinkPointHeader, works for both key and link points.
§

fn pkt_segments(&self) -> ByteSegments<'_>

A utility function to translate this format into bytes for hashing & io
§

fn point_header_ref(&self) -> &PointHeader

§

fn signed(&self) -> Option<&Signed>

§

impl<T> PointExt for Twhere T: Point + ?Sized,

§

fn fields(&self) -> PointFields<'_>

§

fn point_header(&self) -> PointHeader

§

fn is_datapoint(&self) -> bool

§

fn is_linkpoint(&self) -> bool

§

fn is_keypoint(&self) -> bool

§

fn as_datapoint(&self) -> Option<&[u8]>

§

fn as_linkpoint(&self) -> Option<LinkPoint<'_>>

§

fn as_keypoint(&self) -> Option<(LinkPoint<'_>, Signed)>

§

fn group(&self) -> Option<&B64>

§

fn get_group(&self) -> &B64

§

fn domain(&self) -> Option<&AB<[u8; 16]>>

§

fn get_domain(&self) -> &AB<[u8; 16]>

§

fn create_stamp(&self) -> Option<&U64>

§

fn get_create_stamp(&self) -> &U64

§

fn signature(&self) -> Option<&B64<[u8; 64]>>

§

fn get_signature(&self) -> &B64<[u8; 64]>

§

fn pubkey(&self) -> Option<&B64>

§

fn get_pubkey(&self) -> &B64

§

fn rooted_spacename(&self) -> Option<&RootedSpaceBytes<[u8]>>

§

fn spacename(&self) -> Option<&SpaceBytes<[u8]>>

§

fn depth(&self) -> Option<&u8>

§

fn get_depth(&self) -> &u8

§

fn get_rooted_spacename(&self) -> &RootedSpaceBytes<[u8]>

§

fn get_spacename(&self) -> &SpaceBytes<[u8]>

§

fn get_data_str(&self) -> Result<&str, Utf8Error>

§

fn select(&self) -> SelectLink<'_>

§

fn compute_hash(&self) -> B64

§

fn check_private(&self) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more