pub trait DeviceSocketContext<BT: DeviceSocketTypes>: DeviceIdContext<AnyDevice> {
type SocketTablesCoreCtx<'a>: DeviceSocketAccessor<BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>;
// Required methods
fn with_all_device_sockets_mut<F: FnOnce(&mut AllSockets<Self::WeakDeviceId, BT>) -> R, R>(
&mut self,
cb: F,
) -> R;
fn with_any_device_sockets<F: FnOnce(&AnyDeviceSockets<Self::WeakDeviceId, BT>, &mut Self::SocketTablesCoreCtx<'_>) -> R, R>(
&mut self,
cb: F,
) -> R;
fn with_any_device_sockets_mut<F: FnOnce(&mut AnyDeviceSockets<Self::WeakDeviceId, BT>, &mut Self::SocketTablesCoreCtx<'_>) -> R, R>(
&mut self,
cb: F,
) -> R;
}
Expand description
Core context for accessing socket state.
Required Associated Types§
Sourcetype SocketTablesCoreCtx<'a>: DeviceSocketAccessor<BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>
type SocketTablesCoreCtx<'a>: DeviceSocketAccessor<BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>
The core context available in callbacks to methods on this context.
Required Methods§
Sourcefn with_all_device_sockets_mut<F: FnOnce(&mut AllSockets<Self::WeakDeviceId, BT>) -> R, R>(
&mut self,
cb: F,
) -> R
fn with_all_device_sockets_mut<F: FnOnce(&mut AllSockets<Self::WeakDeviceId, BT>) -> R, R>( &mut self, cb: F, ) -> R
Executes the provided callback with mutable access to the collection of all sockets.
Sourcefn with_any_device_sockets<F: FnOnce(&AnyDeviceSockets<Self::WeakDeviceId, BT>, &mut Self::SocketTablesCoreCtx<'_>) -> R, R>(
&mut self,
cb: F,
) -> R
fn with_any_device_sockets<F: FnOnce(&AnyDeviceSockets<Self::WeakDeviceId, BT>, &mut Self::SocketTablesCoreCtx<'_>) -> R, R>( &mut self, cb: F, ) -> R
Executes the provided callback with immutable access to socket state.
Sourcefn with_any_device_sockets_mut<F: FnOnce(&mut AnyDeviceSockets<Self::WeakDeviceId, BT>, &mut Self::SocketTablesCoreCtx<'_>) -> R, R>(
&mut self,
cb: F,
) -> R
fn with_any_device_sockets_mut<F: FnOnce(&mut AnyDeviceSockets<Self::WeakDeviceId, BT>, &mut Self::SocketTablesCoreCtx<'_>) -> R, R>( &mut self, cb: F, ) -> R
Executes the provided callback with mutable access to socket state.
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.