Skip to main content

IpDeviceEgressStateContext

Trait IpDeviceEgressStateContext 

Source
pub trait IpDeviceEgressStateContext<I: IpLayerIpExt>: DeviceIdContext<AnyDevice> {
    // Required methods
    fn with_next_packet_id<O, F: FnOnce(&I::PacketIdState) -> O>(
        &self,
        cb: F,
    ) -> O;
    fn get_local_addr_for_remote(
        &mut self,
        device_id: &Self::DeviceId,
        remote: Option<SpecifiedAddr<I::Addr>>,
    ) -> Option<IpDeviceAddr<I::Addr>>;
    fn get_hop_limit(&mut self, device_id: &Self::DeviceId) -> NonZeroU8;
}
Expand description

Provides access to an IP device’s state for IP layer egress.

Required Methods§

Source

fn with_next_packet_id<O, F: FnOnce(&I::PacketIdState) -> O>(&self, cb: F) -> O

Calls the callback with the next packet ID.

Source

fn get_local_addr_for_remote( &mut self, device_id: &Self::DeviceId, remote: Option<SpecifiedAddr<I::Addr>>, ) -> Option<IpDeviceAddr<I::Addr>>

Returns the best local address for communicating with the remote.

Source

fn get_hop_limit(&mut self, device_id: &Self::DeviceId) -> NonZeroU8

Returns the hop limit.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§