Trait netstack3_ip::IpDeviceContext

source ·
pub trait IpDeviceContext<I: IpLayerIpExt>: IpDeviceStateContext<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.

Object Safety§

This trait is not object safe.

Implementors§