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§
Sourcefn with_next_packet_id<O, F: FnOnce(&I::PacketIdState) -> O>(&self, cb: F) -> O
fn with_next_packet_id<O, F: FnOnce(&I::PacketIdState) -> O>(&self, cb: F) -> O
Calls the callback with the next packet ID.
Sourcefn get_local_addr_for_remote(
&mut self,
device_id: &Self::DeviceId,
remote: Option<SpecifiedAddr<I::Addr>>,
) -> Option<IpDeviceAddr<I::Addr>>
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.
Sourcefn get_hop_limit(&mut self, device_id: &Self::DeviceId) -> NonZeroU8
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", so this trait is not object safe.