pub trait DualStackDatagramBoundStateContext<I: IpExt, BC: DatagramBindingsTypes, S: DatagramSocketSpec>: DeviceIdContext<AnyDevice> {
type IpSocketsCtx<'a>: TransportIpContext<I, BC> + CoreTxMetadataContext<TxMetadata<I, Self::WeakDeviceId, S>, BC> + DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + TransportIpContext<I::OtherVersion, BC> + CoreTxMetadataContext<TxMetadata<I::OtherVersion, Self::WeakDeviceId, S>, BC>;
// Required methods
fn dual_stack_enabled(
&self,
ip_options: &IpOptions<I, Self::WeakDeviceId, S>,
) -> bool;
fn to_other_socket_options<'a>(
&self,
state: &'a IpOptions<I, Self::WeakDeviceId, S>,
) -> &'a DatagramIpSpecificSocketOptions<I::OtherVersion, Self::WeakDeviceId>;
fn ds_converter(&self) -> impl DualStackConverter<I, Self::WeakDeviceId, S>;
fn to_other_bound_socket_id(
&self,
id: &S::SocketId<I, Self::WeakDeviceId>,
) -> <S::SocketMapSpec<I::OtherVersion, Self::WeakDeviceId> as DatagramSocketMapSpec<I::OtherVersion, Self::WeakDeviceId, S::AddrSpec>>::BoundSocketId;
fn with_both_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundDatagramSocketMap<I, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>, &mut BoundDatagramSocketMap<I::OtherVersion, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>) -> O>(
&mut self,
cb: F,
) -> O;
fn with_other_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundDatagramSocketMap<I::OtherVersion, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>) -> O>(
&mut self,
cb: F,
) -> O;
fn with_transport_context<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>) -> O>(
&mut self,
cb: F,
) -> O;
// Provided method
fn assert_dual_stack_enabled(
&self,
ip_options: &IpOptions<I, Self::WeakDeviceId, S>,
) { ... }
}Expand description
Provides access to dual-stack socket state.
Required Associated Types§
Sourcetype IpSocketsCtx<'a>: TransportIpContext<I, BC> + CoreTxMetadataContext<TxMetadata<I, Self::WeakDeviceId, S>, BC> + DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + TransportIpContext<I::OtherVersion, BC> + CoreTxMetadataContext<TxMetadata<I::OtherVersion, Self::WeakDeviceId, S>, BC>
type IpSocketsCtx<'a>: TransportIpContext<I, BC> + CoreTxMetadataContext<TxMetadata<I, Self::WeakDeviceId, S>, BC> + DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + TransportIpContext<I::OtherVersion, BC> + CoreTxMetadataContext<TxMetadata<I::OtherVersion, Self::WeakDeviceId, S>, BC>
The core context passed to the callbacks to methods.
Required Methods§
Sourcefn dual_stack_enabled(
&self,
ip_options: &IpOptions<I, Self::WeakDeviceId, S>,
) -> bool
fn dual_stack_enabled( &self, ip_options: &IpOptions<I, Self::WeakDeviceId, S>, ) -> bool
Returns if the socket state indicates dual-stack operation is enabled.
Sourcefn to_other_socket_options<'a>(
&self,
state: &'a IpOptions<I, Self::WeakDeviceId, S>,
) -> &'a DatagramIpSpecificSocketOptions<I::OtherVersion, Self::WeakDeviceId>
fn to_other_socket_options<'a>( &self, state: &'a IpOptions<I, Self::WeakDeviceId, S>, ) -> &'a DatagramIpSpecificSocketOptions<I::OtherVersion, Self::WeakDeviceId>
Returns the DatagramIpSpecificSocketOptions to use for packets in the other stack.
Sourcefn ds_converter(&self) -> impl DualStackConverter<I, Self::WeakDeviceId, S>
fn ds_converter(&self) -> impl DualStackConverter<I, Self::WeakDeviceId, S>
Returns an instance of a type that implements DualStackConverter
for addresses.
Sourcefn to_other_bound_socket_id(
&self,
id: &S::SocketId<I, Self::WeakDeviceId>,
) -> <S::SocketMapSpec<I::OtherVersion, Self::WeakDeviceId> as DatagramSocketMapSpec<I::OtherVersion, Self::WeakDeviceId, S::AddrSpec>>::BoundSocketId
fn to_other_bound_socket_id( &self, id: &S::SocketId<I, Self::WeakDeviceId>, ) -> <S::SocketMapSpec<I::OtherVersion, Self::WeakDeviceId> as DatagramSocketMapSpec<I::OtherVersion, Self::WeakDeviceId, S::AddrSpec>>::BoundSocketId
Converts a socket ID to a bound socket ID.
Converts a socket ID for IP version I into a bound socket ID that can
be inserted into the demultiplexing map for IP version I::OtherVersion.
Sourcefn with_both_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundDatagramSocketMap<I, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>, &mut BoundDatagramSocketMap<I::OtherVersion, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>) -> O>(
&mut self,
cb: F,
) -> O
fn with_both_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundDatagramSocketMap<I, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>, &mut BoundDatagramSocketMap<I::OtherVersion, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>) -> O>( &mut self, cb: F, ) -> O
Calls the provided callback with mutable access to both the demultiplexing maps.
Sourcefn with_other_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundDatagramSocketMap<I::OtherVersion, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>) -> O>(
&mut self,
cb: F,
) -> O
fn with_other_bound_sockets_mut<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>, &mut BoundDatagramSocketMap<I::OtherVersion, <Self as DeviceIdContext<AnyDevice>>::WeakDeviceId, S>) -> O>( &mut self, cb: F, ) -> O
Calls the provided callback with mutable access to the demultiplexing map for the other IP version.
Sourcefn with_transport_context<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>) -> O>(
&mut self,
cb: F,
) -> O
fn with_transport_context<O, F: FnOnce(&mut Self::IpSocketsCtx<'_>) -> O>( &mut self, cb: F, ) -> O
Calls the provided callback with access to the IpSocketsCtx.
Provided Methods§
Sourcefn assert_dual_stack_enabled(
&self,
ip_options: &IpOptions<I, Self::WeakDeviceId, S>,
)
fn assert_dual_stack_enabled( &self, ip_options: &IpOptions<I, Self::WeakDeviceId, S>, )
Asserts that the socket options indicates dual-stack operation is enabled.
Provided trait function.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".