pub struct NetworkSerializationContext { /* private fields */ }Expand description
A concrete serialization context for the entire network stack.
Implementations§
Source§impl NetworkSerializationContext
impl NetworkSerializationContext
Sourcepub fn new(
csum_offload_spec: ChecksumOffloadSpec,
) -> NetworkSerializationContext
pub fn new( csum_offload_spec: ChecksumOffloadSpec, ) -> NetworkSerializationContext
Creates a new NetworkSerializationContext with the given checksum offload capabilities.
Sourcepub fn csum_offload_result(self) -> Option<ChecksumOffloadResult>
pub fn csum_offload_result(self) -> Option<ChecksumOffloadResult>
Returns the result of the checksum offloading operation for the current packet, if any.
Trait Implementations§
Source§impl Clone for NetworkSerializationContext
impl Clone for NetworkSerializationContext
Source§fn clone(&self) -> NetworkSerializationContext
fn clone(&self) -> NetworkSerializationContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkSerializationContext
impl Debug for NetworkSerializationContext
Source§impl Default for NetworkSerializationContext
impl Default for NetworkSerializationContext
Source§fn default() -> NetworkSerializationContext
fn default() -> NetworkSerializationContext
Returns the “default value” for a type. Read more
Source§impl EthernetSerializationContext for NetworkSerializationContext
impl EthernetSerializationContext for NetworkSerializationContext
Source§fn envelope_to_state(
_envelope: EthernetEnvelope,
) -> <NetworkSerializationContext as SerializationContext>::ContextState
fn envelope_to_state( _envelope: EthernetEnvelope, ) -> <NetworkSerializationContext as SerializationContext>::ContextState
Converts an
EthernetEnvelope into the serialization context’s state.Source§impl IcmpSerializationContext for NetworkSerializationContext
impl IcmpSerializationContext for NetworkSerializationContext
Source§fn envelope_to_state(
_envelope: IcmpEnvelope,
) -> <NetworkSerializationContext as SerializationContext>::ContextState
fn envelope_to_state( _envelope: IcmpEnvelope, ) -> <NetworkSerializationContext as SerializationContext>::ContextState
Converts an
IcmpEnvelope into the serialization context’s state.Source§impl<I> IpSerializationContext<I> for NetworkSerializationContextwhere
I: IpExt,
impl<I> IpSerializationContext<I> for NetworkSerializationContextwhere
I: IpExt,
Source§fn envelope_to_state(
envelope: IpEnvelope<I>,
) -> <NetworkSerializationContext as SerializationContext>::ContextState
fn envelope_to_state( envelope: IpEnvelope<I>, ) -> <NetworkSerializationContext as SerializationContext>::ContextState
Converts an
IpEnvelope into the serialization context’s state.Source§impl PartialEq for NetworkSerializationContext
impl PartialEq for NetworkSerializationContext
Source§fn eq(&self, other: &NetworkSerializationContext) -> bool
fn eq(&self, other: &NetworkSerializationContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl SerializationContext for NetworkSerializationContext
impl SerializationContext for NetworkSerializationContext
Source§type ContextState = OffloadableProtocol
type ContextState = OffloadableProtocol
The packet-specific state required by this serialization context.
Source§fn serialize_nested<O, R>(
&mut self,
outer: &O,
constraints: PacketConstraints,
serialize_fn: impl FnOnce(&mut NetworkSerializationContext, PacketConstraints) -> R,
) -> Rwhere
O: PacketBuilder<NetworkSerializationContext>,
fn serialize_nested<O, R>(
&mut self,
outer: &O,
constraints: PacketConstraints,
serialize_fn: impl FnOnce(&mut NetworkSerializationContext, PacketConstraints) -> R,
) -> Rwhere
O: PacketBuilder<NetworkSerializationContext>,
Performs nested serialization within the context of an outer
PacketBuilder. Read moreSource§impl TcpSerializationContext for NetworkSerializationContext
impl TcpSerializationContext for NetworkSerializationContext
Source§fn envelope_to_state(
_envelope: TcpEnvelope,
) -> <NetworkSerializationContext as SerializationContext>::ContextState
fn envelope_to_state( _envelope: TcpEnvelope, ) -> <NetworkSerializationContext as SerializationContext>::ContextState
Converts a
TcpEnvelope into the serialization context’s state.Source§fn checksum_action(&mut self) -> TransportChecksumAction
fn checksum_action(&mut self) -> TransportChecksumAction
Returns the checksum action to take based on the serialization context.
Source§impl UdpSerializationContext for NetworkSerializationContext
impl UdpSerializationContext for NetworkSerializationContext
Source§fn envelope_to_state(
_envelope: UdpEnvelope,
) -> <NetworkSerializationContext as SerializationContext>::ContextState
fn envelope_to_state( _envelope: UdpEnvelope, ) -> <NetworkSerializationContext as SerializationContext>::ContextState
Converts a
UdpEnvelope into the serialization context’s state.Source§fn checksum_action(&mut self) -> TransportChecksumAction
fn checksum_action(&mut self) -> TransportChecksumAction
Returns the checksum action to take based on the serialization context.
impl Eq for NetworkSerializationContext
impl StructuralPartialEq for NetworkSerializationContext
Auto Trait Implementations§
impl Freeze for NetworkSerializationContext
impl RefUnwindSafe for NetworkSerializationContext
impl Send for NetworkSerializationContext
impl Sync for NetworkSerializationContext
impl Unpin for NetworkSerializationContext
impl UnsafeUnpin for NetworkSerializationContext
impl UnwindSafe for NetworkSerializationContext
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<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> 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§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
fn send_frame<S>( &mut self, bindings_ctx: &mut BC, metadata: Meta, frame: S, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
Send a frame. Read more
Source§impl<BC, S, Meta, DeviceId> SendableFrameMeta<FakeCoreCtx<S, Meta, DeviceId>, BC> for Meta
impl<BC, S, Meta, DeviceId> SendableFrameMeta<FakeCoreCtx<S, Meta, DeviceId>, BC> for Meta
Source§fn send_meta<SS>(
self,
core_ctx: &mut FakeCoreCtx<S, Meta, DeviceId>,
bindings_ctx: &mut BC,
frame: SS,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, SS>>
fn send_meta<SS>( self, core_ctx: &mut FakeCoreCtx<S, Meta, DeviceId>, bindings_ctx: &mut BC, frame: SS, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, SS>>
Sends this frame metadata to the provided contexts.
Source§impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
Source§fn send_meta<S>(
self,
core_ctx: &mut FakeFrameCtx<Meta>,
_bindings_ctx: &mut BC,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
fn send_meta<S>( self, core_ctx: &mut FakeFrameCtx<Meta>, _bindings_ctx: &mut BC, frame: S, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
Sends this frame metadata to the provided contexts.
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more
Source§impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
Source§type Data = <L as UnlockedAccessMarkerFor<T>>::Data
type Data = <L as UnlockedAccessMarkerFor<T>>::Data
The type of state being accessed.
Source§type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data
where
T: 'l
type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data where T: 'l
A guard providing read access to the data.
Source§fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
How to access the state.