netstack3_device::pure_ip

Trait PureIpDeviceStateContext

Source
pub trait PureIpDeviceStateContext: DeviceIdContext<PureIpDevice> {
    // Required methods
    fn with_pure_ip_state<O, F: FnOnce(&DynamicPureIpDeviceState) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn with_pure_ip_state_mut<O, F: FnOnce(&mut DynamicPureIpDeviceState) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
}
Expand description

Provides access to a pure IP device’s state.

Required Methods§

Source

fn with_pure_ip_state<O, F: FnOnce(&DynamicPureIpDeviceState) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with an immutable reference to the pure IP device’s dynamic state.

Source

fn with_pure_ip_state_mut<O, F: FnOnce(&mut DynamicPureIpDeviceState) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with a mutable reference to the pure IP device’s dynamic 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.

Implementors§