pub trait DatagramSpecStateContext<I: IpExt, CC: DeviceIdContext<AnyDevice>, BC>: DatagramSocketSpec {
type SocketsStateCtx<'a>: DatagramBoundStateContext<I, BC, Self> + DeviceIdContext<AnyDevice, DeviceId = CC::DeviceId, WeakDeviceId = CC::WeakDeviceId>;
// Required methods
fn with_all_sockets_mut<O, F: FnOnce(&mut DatagramSocketSet<I, CC::WeakDeviceId, Self>) -> O>(
core_ctx: &mut CC,
cb: F,
) -> O;
fn with_all_sockets<O, F: FnOnce(&DatagramSocketSet<I, CC::WeakDeviceId, Self>) -> O>(
core_ctx: &mut CC,
cb: F,
) -> O;
fn with_socket_state<O, F: FnOnce(&mut Self::SocketsStateCtx<'_>, &SocketState<I, CC::WeakDeviceId, Self>) -> O>(
core_ctx: &mut CC,
id: &Self::SocketId<I, CC::WeakDeviceId>,
cb: F,
) -> O;
fn with_socket_state_mut<O, F: FnOnce(&mut Self::SocketsStateCtx<'_>, &mut SocketState<I, CC::WeakDeviceId, Self>) -> O>(
core_ctx: &mut CC,
id: &Self::SocketId<I, CC::WeakDeviceId>,
cb: F,
) -> O;
fn for_each_socket<F: FnMut(&mut Self::SocketsStateCtx<'_>, &Self::SocketId<I, CC::WeakDeviceId>, &SocketState<I, CC::WeakDeviceId, Self>)>(
core_ctx: &mut CC,
cb: F,
);
}
Expand description
A mirror trait of DatagramStateContext
allowing foreign crates to
provide blanket impls for it.
This trait repeats all the definitions in DatagramStateContext
to
provide blanket impls from an implementation on the type implementing
DatagramSocketSpec
, which is local for foreign implementers.
See DatagramStateContext
for details.
Required Associated Types§
type SocketsStateCtx<'a>: DatagramBoundStateContext<I, BC, Self> + DeviceIdContext<AnyDevice, DeviceId = CC::DeviceId, WeakDeviceId = CC::WeakDeviceId>
Required Methods§
fn with_all_sockets_mut<O, F: FnOnce(&mut DatagramSocketSet<I, CC::WeakDeviceId, Self>) -> O>( core_ctx: &mut CC, cb: F, ) -> O
fn with_all_sockets<O, F: FnOnce(&DatagramSocketSet<I, CC::WeakDeviceId, Self>) -> O>( core_ctx: &mut CC, cb: F, ) -> O
fn with_socket_state<O, F: FnOnce(&mut Self::SocketsStateCtx<'_>, &SocketState<I, CC::WeakDeviceId, Self>) -> O>( core_ctx: &mut CC, id: &Self::SocketId<I, CC::WeakDeviceId>, cb: F, ) -> O
fn with_socket_state_mut<O, F: FnOnce(&mut Self::SocketsStateCtx<'_>, &mut SocketState<I, CC::WeakDeviceId, Self>) -> O>( core_ctx: &mut CC, id: &Self::SocketId<I, CC::WeakDeviceId>, cb: F, ) -> O
fn for_each_socket<F: FnMut(&mut Self::SocketsStateCtx<'_>, &Self::SocketId<I, CC::WeakDeviceId>, &SocketState<I, CC::WeakDeviceId, Self>)>( core_ctx: &mut CC, cb: F, )
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.