Trait netstack3_udp::DualStackBoundStateContext

source ·
pub trait DualStackBoundStateContext<I: IpExt, BC: UdpBindingsContext<I, Self::DeviceId>>: DeviceIdContext<AnyDevice> {
    type IpSocketsCtx<'a>: TransportIpContext<I, BC> + DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + TransportIpContext<I::OtherVersion, BC>;

    // Required methods
    fn with_both_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundSockets<I, Self::WeakDeviceId, BC>, &mut BoundSockets<I::OtherVersion, Self::WeakDeviceId, BC>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn with_other_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundSockets<I::OtherVersion, Self::WeakDeviceId, BC>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn with_transport_context<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
}
Expand description

An execution context for UDP dual-stack operations.

Required Associated Types§

source

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

The core context passed to the callbacks to methods.

Required Methods§

source

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

Calls the provided callback with mutable access to both the demultiplexing maps.

source

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

Calls the provided callback with mutable access to the demultiplexing map for the other IP version.

source

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

Calls the provided callback with access to the IpSocketsCtx.

Object Safety§

This trait is not object safe.

Implementors§