pub struct NetPktArc(/* private fields */);
Expand description

Arc around the byte repr NetPkt

Send + Sync + cheap Clone, super::NetPktHeader is immutable

Implementations§

§

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

Safety

must be created through Self::into_raw_arc

pub unsafe fn from_header_and_copy( partial: PartialNetHeader, skip_hash: bool, copy_from: impl FnOnce(&mut [u8]) ) -> Result<NetPktArc, Error>

Safety

copy_from must input the correct bytes.

Methods from Deref<Target = NetPktArcPtr>§

pub fn netpktptr(&self) -> &NetPktPtr

pub fn with_arc<U>(&self, f: impl FnOnce(&NetPktArc) -> U) -> U

Get a look at the outer NetPktArc

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>

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 Borrow<NetPktArcPtr> for NetPktArc

§

fn borrow(&self) -> &NetPktArcPtr

Immutably borrows from an owned value. Read more
§

impl Clone for NetPktArc

§

fn clone(&self) -> NetPktArc

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NetPktArc

§

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

Formats the value using the given formatter. Read more
§

impl Deref for NetPktArc

§

type Target = NetPktArcPtr

The resulting type after dereferencing.
§

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

Dereferences the value.
§

impl<'de> Deserialize<'de> for NetPktArc

§

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 From<&dyn NetPkt> for NetPktArc

§

fn from(value: &dyn NetPkt) -> NetPktArc

Converts to this type from the input type.
§

impl<'o> From<NetPktParts<'o>> for NetPktArc

§

fn from(value: NetPktParts<'o>) -> NetPktArc

Converts to this type from the input type.
§

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>

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

§

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§

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,