Trait netstack3_device::socket::SocketStateAccessor
source · 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.
Object Safety§
This trait is not object safe.