pub trait SocketStateAccessor<BT: DeviceSocketTypes>: DeviceIdContext<AnyDevice> {
// Required methods
fn with_socket_state<F: FnOnce(&BT::SocketState, &Target<Self::WeakDeviceId>) -> R, R>(
&mut self,
socket: &DeviceSocketId<Self::WeakDeviceId, BT>,
cb: F,
) -> R;
fn with_socket_state_mut<F: FnOnce(&BT::SocketState, &mut Target<Self::WeakDeviceId>) -> R, R>(
&mut self,
socket: &DeviceSocketId<Self::WeakDeviceId, BT>,
cb: F,
) -> R;
}
Expand description
Core context for accessing the state of an individual socket.
Required Methods§
Sourcefn with_socket_state<F: FnOnce(&BT::SocketState, &Target<Self::WeakDeviceId>) -> R, R>(
&mut self,
socket: &DeviceSocketId<Self::WeakDeviceId, BT>,
cb: F,
) -> R
fn with_socket_state<F: FnOnce(&BT::SocketState, &Target<Self::WeakDeviceId>) -> R, R>( &mut self, socket: &DeviceSocketId<Self::WeakDeviceId, BT>, cb: F, ) -> R
Provides read-only access to the state of a socket.
Sourcefn with_socket_state_mut<F: FnOnce(&BT::SocketState, &mut Target<Self::WeakDeviceId>) -> R, R>(
&mut self,
socket: &DeviceSocketId<Self::WeakDeviceId, BT>,
cb: F,
) -> R
fn with_socket_state_mut<F: FnOnce(&BT::SocketState, &mut Target<Self::WeakDeviceId>) -> R, R>( &mut self, socket: &DeviceSocketId<Self::WeakDeviceId, BT>, cb: F, ) -> R
Provides mutable access to the state of a socket.
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.