netstack3_ip::raw

Trait RawIpSocketMapContext

Source
pub trait RawIpSocketMapContext<I: IpExt, BT: RawIpSocketsBindingsTypes>: DeviceIdContext<AnyDevice> {
    type StateCtx<'a>: RawIpSocketStateContext<I, BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + ResourceCounterContext<RawIpSocketId<I, Self::WeakDeviceId, BT>, RawIpSocketCounters<I>>;

    // Required methods
    fn with_socket_map_and_state_ctx<O, F: FnOnce(&RawIpSocketMap<I, Self::WeakDeviceId, BT>, &mut Self::StateCtx<'_>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn with_socket_map_mut<O, F: FnOnce(&mut RawIpSocketMap<I, Self::WeakDeviceId, BT>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
}
Expand description

A type that provides access to the RawIpSocketMap used by the system.

Required Associated Types§

Source

type StateCtx<'a>: RawIpSocketStateContext<I, BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + ResourceCounterContext<RawIpSocketId<I, Self::WeakDeviceId, BT>, RawIpSocketCounters<I>>

The implementation of RawIpSocketStateContext available after having accessed the system’s socket map.

Required Methods§

Source

fn with_socket_map_and_state_ctx<O, F: FnOnce(&RawIpSocketMap<I, Self::WeakDeviceId, BT>, &mut Self::StateCtx<'_>) -> O>( &mut self, cb: F, ) -> O

Calls the callback with an immutable reference to the socket map.

Source

fn with_socket_map_mut<O, F: FnOnce(&mut RawIpSocketMap<I, Self::WeakDeviceId, BT>) -> O>( &mut self, cb: F, ) -> O

Calls the callback with a mutable reference to the socket map.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§