netstack3_ip

Trait IpDeviceContext

Source
pub trait IpDeviceContext<I: IpLayerIpExt>: IpDeviceEgressStateContext<I> + IpDeviceIngressStateContext<I> {
    type DeviceAndAddressStatusIter<'a>: Iterator<Item = (Self::DeviceId, I::AddressStatus)>;

    // Required methods
    fn is_ip_device_enabled(&mut self, device_id: &Self::DeviceId) -> bool;
    fn with_address_statuses<F: FnOnce(Self::DeviceAndAddressStatusIter<'_>) -> R, R>(
        &mut self,
        addr: SpecifiedAddr<I::Addr>,
        cb: F,
    ) -> R;
    fn is_device_unicast_forwarding_enabled(
        &mut self,
        device_id: &Self::DeviceId,
    ) -> bool;
}
Expand description

The IP device context provided to the IP layer.

Required Associated Types§

Required Methods§

Source

fn is_ip_device_enabled(&mut self, device_id: &Self::DeviceId) -> bool

Is the device enabled?

Source

fn with_address_statuses<F: FnOnce(Self::DeviceAndAddressStatusIter<'_>) -> R, R>( &mut self, addr: SpecifiedAddr<I::Addr>, cb: F, ) -> R

Provides access to the status of an address.

Calls the provided callback with an iterator over the devices for which the address is assigned and the status of the assignment for each device.

Source

fn is_device_unicast_forwarding_enabled( &mut self, device_id: &Self::DeviceId, ) -> bool

Returns true iff the device has unicast forwarding enabled.

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§