pub struct PacketMessage<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize>(PaddedPayload<P>, PhantomData<(S, H)>);Expand description
Additional encoding of a packet message that can be preceded by a number of SURBs.
Tuple Fields§
§0: PaddedPayload<P>§1: PhantomData<(S, H)>Implementations§
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> PacketMessage<S, H, P>
impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> PacketMessage<S, H, P>
Sourcepub const HEADER_LEN: usize = 1
pub const HEADER_LEN: usize = 1
Size of the message header.
This is currently 1 byte to indicate the number of SURBs that precede the message.
Sourcepub const MAX_SURBS_PER_MESSAGE: usize
pub const MAX_SURBS_PER_MESSAGE: usize
The maximum number of SURBs a packet message can hold, according to RFC-0003.
The number of SURBs in a PacketMessage is intentionally limited to 15, so that
the upper 4 bits remain reserved for additional flags.
Trait Implementations§
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> From<PacketMessage<S, H, P>> for PaddedPayload<P>
impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> From<PacketMessage<S, H, P>> for PaddedPayload<P>
Source§fn from(value: PacketMessage<S, H, P>) -> Self
fn from(value: PacketMessage<S, H, P>) -> Self
Converts to this type from the input type.
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> From<PaddedPayload<P>> for PacketMessage<S, H, P>
impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> From<PaddedPayload<P>> for PacketMessage<S, H, P>
Source§fn from(value: PaddedPayload<P>) -> Self
fn from(value: PaddedPayload<P>) -> Self
Converts to this type from the input type.
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> TryFrom<PacketMessage<S, H, P>> for PacketParts<'_, S, H>
impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> TryFrom<PacketMessage<S, H, P>> for PacketParts<'_, S, H>
Source§type Error = SphinxError
type Error = SphinxError
The type returned in the event of a conversion error.
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> TryFrom<PacketParts<'_, S, H>> for PacketMessage<S, H, P>
impl<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> TryFrom<PacketParts<'_, S, H>> for PacketMessage<S, H, P>
Source§type Error = SphinxError
type Error = SphinxError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<S, H, const P: usize> Freeze for PacketMessage<S, H, P>
impl<S, H, const P: usize> RefUnwindSafe for PacketMessage<S, H, P>where
S: RefUnwindSafe,
H: RefUnwindSafe,
impl<S, H, const P: usize> Send for PacketMessage<S, H, P>
impl<S, H, const P: usize> Sync for PacketMessage<S, H, P>
impl<S, H, const P: usize> Unpin for PacketMessage<S, H, P>
impl<S, H, const P: usize> UnwindSafe for PacketMessage<S, H, P>where
S: UnwindSafe,
H: UnwindSafe,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more