pub struct NestedWithInnerIpPacket<Inner, Outer>(/* private fields */);
Expand description
A nested serializer whose inner serializer implements IpPacket
.
[packet::Nested
] is often used to represent an outer IP packet serializer
and an inner payload contained by the IP packet. However, in some cases, a
type that implements IpPacket
may itself be wrapped in an outer
serializer, such as (for example) a [packet::LimitedSizePacketBuilder
] for
enforcing an MTU. In that scenario, the Nested
serializer can be wrapped
in this type to indicate that the IpPacket
implementation should be
delegated to the inner serializer.
Implementations§
source§impl<Inner, Outer> NestedWithInnerIpPacket<Inner, Outer>
impl<Inner, Outer> NestedWithInnerIpPacket<Inner, Outer>
sourcepub fn new(nested: Nested<Inner, Outer>) -> Self
pub fn new(nested: Nested<Inner, Outer>) -> Self
Creates a new NestedWithInnerIpPacket
wrapping the provided nested
serializer.
sourcepub fn into_inner(self) -> Inner
pub fn into_inner(self) -> Inner
Calls [Nested::into_inner
] on the contained nested serializer.
Trait Implementations§
source§impl<I: IpExt, Inner: IpPacket<I>, Outer> IpPacket<I> for NestedWithInnerIpPacket<Inner, Outer>
impl<I: IpExt, Inner: IpPacket<I>, Outer> IpPacket<I> for NestedWithInnerIpPacket<Inner, Outer>
§type TransportPacket<'a> = <Inner as IpPacket<I>>::TransportPacket<'a>
where
Inner: 'a,
Outer: 'a
type TransportPacket<'a> = <Inner as IpPacket<I>>::TransportPacket<'a> where Inner: 'a, Outer: 'a
The type that provides access to transport-layer header inspection, if a
transport header is contained in the body of the IP packet.
source§fn transport_packet(&self) -> Self::TransportPacket<'_>
fn transport_packet(&self) -> Self::TransportPacket<'_>
Returns a type that provides access to the transport-layer packet contained
in the body of the IP packet, if one exists. Read more
source§impl<Inner, Outer> Serializer for NestedWithInnerIpPacket<Inner, Outer>where
Nested<Inner, Outer>: Serializer,
impl<Inner, Outer> Serializer for NestedWithInnerIpPacket<Inner, Outer>where
Nested<Inner, Outer>: Serializer,
§type Buffer = <Nested<Inner, Outer> as Serializer>::Buffer
type Buffer = <Nested<Inner, Outer> as Serializer>::Buffer
The type of buffers returned from serialization methods on this trait.
source§fn serialize<G: GrowBufferMut, P: BufferProvider<Self::Buffer, G>>(
self,
outer: PacketConstraints,
provider: P
) -> Result<G, (SerializeError<P::Error>, Self)>
fn serialize<G: GrowBufferMut, P: BufferProvider<Self::Buffer, G>>( self, outer: PacketConstraints, provider: P ) -> Result<G, (SerializeError<P::Error>, Self)>
Serializes this
Serializer
, producing a buffer. Read more§fn serialize_outer<B, P>(
self,
provider: P
) -> Result<B, (SerializeError<<P as BufferProvider<Self::Buffer, B>>::Error>, Self)>where
B: GrowBufferMut,
P: BufferProvider<Self::Buffer, B>,
fn serialize_outer<B, P>(
self,
provider: P
) -> Result<B, (SerializeError<<P as BufferProvider<Self::Buffer, B>>::Error>, Self)>where
B: GrowBufferMut,
P: BufferProvider<Self::Buffer, B>,
Serializes this
Serializer
as the outermost packet. Read more§fn encapsulate<B>(self, outer: B) -> Nested<Self, B>
fn encapsulate<B>(self, outer: B) -> Nested<Self, B>
§fn with_size_limit(self, limit: usize) -> Nested<Self, LimitedSizePacketBuilder>
fn with_size_limit(self, limit: usize) -> Nested<Self, LimitedSizePacketBuilder>
Creates a new
Serializer
which will enforce a size limit. Read moreAuto Trait Implementations§
impl<Inner, Outer> Freeze for NestedWithInnerIpPacket<Inner, Outer>
impl<Inner, Outer> RefUnwindSafe for NestedWithInnerIpPacket<Inner, Outer>where
Inner: RefUnwindSafe,
Outer: RefUnwindSafe,
impl<Inner, Outer> Send for NestedWithInnerIpPacket<Inner, Outer>
impl<Inner, Outer> Sync for NestedWithInnerIpPacket<Inner, Outer>
impl<Inner, Outer> Unpin for NestedWithInnerIpPacket<Inner, Outer>
impl<Inner, Outer> UnwindSafe for NestedWithInnerIpPacket<Inner, Outer>where
Inner: UnwindSafe,
Outer: 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> 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<CC, BC, Meta> RecvFrameContext<BC, Meta> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<BC, Meta> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
source§impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
source§fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
Handle a timer firing.