pub trait BaseTransportIpContext<I: IpExt, BC>: DeviceIdContext<AnyDevice> {
type DevicesWithAddrIter<'s>: Iterator<Item = Self::DeviceId>;
// Required methods
fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>(
&mut self,
addr: SpecifiedAddr<I::Addr>,
cb: F,
) -> O;
fn get_default_hop_limits(
&mut self,
device: Option<&Self::DeviceId>,
) -> HopLimits;
fn get_original_destination(
&mut self,
tuple: &Tuple<I>,
) -> Option<(I::Addr, u16)>;
}
Expand description
The base execution context provided by the IP layer to transport layer protocols.
Required Associated Types§
Sourcetype DevicesWithAddrIter<'s>: Iterator<Item = Self::DeviceId>
type DevicesWithAddrIter<'s>: Iterator<Item = Self::DeviceId>
The iterator given to
BaseTransportIpContext::with_devices_with_assigned_addr
.
Required Methods§
Sourcefn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>(
&mut self,
addr: SpecifiedAddr<I::Addr>,
cb: F,
) -> O
fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>( &mut self, addr: SpecifiedAddr<I::Addr>, cb: F, ) -> O
Is this one of our local addresses, and is it in the assigned state?
Calls cb
with an iterator over all the local interfaces for which
addr
is an associated address, and, for IPv6, for which it is in the
“assigned” state.
Sourcefn get_default_hop_limits(
&mut self,
device: Option<&Self::DeviceId>,
) -> HopLimits
fn get_default_hop_limits( &mut self, device: Option<&Self::DeviceId>, ) -> HopLimits
Get default hop limits.
If device
is not None
and exists, its hop limits will be returned.
Otherwise the system defaults are returned.
Sourcefn get_original_destination(
&mut self,
tuple: &Tuple<I>,
) -> Option<(I::Addr, u16)>
fn get_original_destination( &mut self, tuple: &Tuple<I>, ) -> Option<(I::Addr, u16)>
Gets the original destination for the tracked connection indexed by
tuple
, which includes the source and destination addresses and
transport-layer ports as well as the transport protocol number.
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.