Trait netstack3_udp::BoundStateContext

source ·
pub trait BoundStateContext<I: IpExt, BC: UdpBindingsContext<I, Self::DeviceId>>: DeviceIdContext<AnyDevice> + UdpStateContext {
    type IpSocketsCtx<'a>: TransportIpContext<I, BC> + MulticastMembershipHandler<I, BC> + DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>;
    type DualStackContext: DualStackDatagramBoundStateContext<I, BC, Udp<BC>, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>;
    type NonDualStackContext: NonDualStackDatagramBoundStateContext<I, BC, Udp<BC>, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>;

    // Required methods
    fn with_bound_sockets<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &BoundSockets<I, Self::WeakDeviceId, BC>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn with_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundSockets<I, Self::WeakDeviceId, BC>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn dual_stack_context(
        &mut self,
    ) -> MaybeDualStack<&mut Self::DualStackContext, &mut Self::NonDualStackContext>;
    fn with_transport_context<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
}
Expand description

An execution context for the UDP protocol which also provides access to state.

Required Associated Types§

source

type IpSocketsCtx<'a>: TransportIpContext<I, BC> + MulticastMembershipHandler<I, BC> + DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>

The core context passed to the callback provided to methods.

source

type DualStackContext: DualStackDatagramBoundStateContext<I, BC, Udp<BC>, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>

The inner dual stack context.

source

type NonDualStackContext: NonDualStackDatagramBoundStateContext<I, BC, Udp<BC>, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>

The inner non dual stack context.

Required Methods§

source

fn with_bound_sockets<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &BoundSockets<I, Self::WeakDeviceId, BC>) -> O>( &mut self, cb: F, ) -> O

Calls the function with an immutable reference to UDP sockets.

source

fn with_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundSockets<I, Self::WeakDeviceId, BC>) -> O>( &mut self, cb: F, ) -> O

Calls the function with a mutable reference to UDP sockets.

source

fn dual_stack_context( &mut self, ) -> MaybeDualStack<&mut Self::DualStackContext, &mut Self::NonDualStackContext>

Returns a context for dual- or non-dual-stack operation.

source

fn with_transport_context<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>) -> O>( &mut self, cb: F, ) -> O

Calls the function without access to the UDP bound socket state.

Object Safety§

This trait is not object safe.

Implementors§