netstack3_device::ethernet

Trait EthernetIpLinkDeviceDynamicStateContext

Source
pub trait EthernetIpLinkDeviceDynamicStateContext<BC: EthernetIpLinkDeviceBindingsContext>: EthernetIpLinkDeviceStaticStateContext {
    // Required methods
    fn with_ethernet_state<O, F: FnOnce(&StaticEthernetDeviceState, &DynamicEthernetDeviceState) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn with_ethernet_state_mut<O, F: FnOnce(&StaticEthernetDeviceState, &mut DynamicEthernetDeviceState) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
}
Expand description

Provides access to an ethernet device’s dynamic state.

Required Methods§

Source

fn with_ethernet_state<O, F: FnOnce(&StaticEthernetDeviceState, &DynamicEthernetDeviceState) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with the ethernet device’s static state and immutable reference to the dynamic state.

Source

fn with_ethernet_state_mut<O, F: FnOnce(&StaticEthernetDeviceState, &mut DynamicEthernetDeviceState) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with the ethernet device’s static state and mutable reference to the 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§