Trait netstack3_ip::IpDeviceStateContext
source · pub trait IpDeviceStateContext<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;
fn address_status_for_device(
&mut self,
addr: SpecifiedAddr<I::Addr>,
device_id: &Self::DeviceId,
) -> AddressStatus<I::AddressStatus>;
}
Expand description
Provides access to an IP device’s state for the IP layer.
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.
sourcefn address_status_for_device(
&mut self,
addr: SpecifiedAddr<I::Addr>,
device_id: &Self::DeviceId,
) -> AddressStatus<I::AddressStatus>
fn address_status_for_device( &mut self, addr: SpecifiedAddr<I::Addr>, device_id: &Self::DeviceId, ) -> AddressStatus<I::AddressStatus>
Gets the status of an address.
Only the specified device will be checked for the address. Returns
AddressStatus::Unassigned
if the address is not assigned to the
device.
Object Safety§
This trait is not object safe.