pub trait IpDeviceStateContext<I: IpDeviceIpExt, BT: IpDeviceStateBindingsTypes>: IpDeviceAddressContext<I, BT> {
type IpDeviceAddressCtx<'a>: IpDeviceAddressContext<I, BT, DeviceId = Self::DeviceId, AddressId = Self::AddressId>;
type AddressIdsIter<'a>: Iterator<Item = Self::AddressId> + 'a;
// Required methods
fn with_ip_device_flags<O, F: FnOnce(&IpDeviceFlags) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O;
fn add_ip_address(
&mut self,
device_id: &Self::DeviceId,
addr: AddrSubnet<I::Addr, I::AssignedWitness>,
config: I::AddressConfig<BT::Instant>,
) -> Result<Self::AddressId, ExistsError>;
fn remove_ip_address(
&mut self,
device_id: &Self::DeviceId,
addr: Self::AddressId,
) -> RemoveResourceResultWithContext<AddrSubnet<I::Addr>, BT>;
fn get_address_id(
&mut self,
device_id: &Self::DeviceId,
addr: SpecifiedAddr<I::Addr>,
) -> Result<Self::AddressId, NotFoundError>;
fn with_address_ids<O, F: FnOnce(Self::AddressIdsIter<'_>, &mut Self::IpDeviceAddressCtx<'_>) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O;
fn with_default_hop_limit<O, F: FnOnce(&NonZeroU8) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O;
fn with_default_hop_limit_mut<O, F: FnOnce(&mut NonZeroU8) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O;
fn join_link_multicast_group(
&mut self,
bindings_ctx: &mut BT,
device_id: &Self::DeviceId,
multicast_addr: MulticastAddr<I::Addr>,
);
fn leave_link_multicast_group(
&mut self,
bindings_ctx: &mut BT,
device_id: &Self::DeviceId,
multicast_addr: MulticastAddr<I::Addr>,
);
}
Expand description
Accessor for IP device state.
Required Associated Types§
Sourcetype IpDeviceAddressCtx<'a>: IpDeviceAddressContext<I, BT, DeviceId = Self::DeviceId, AddressId = Self::AddressId>
type IpDeviceAddressCtx<'a>: IpDeviceAddressContext<I, BT, DeviceId = Self::DeviceId, AddressId = Self::AddressId>
Inner accessor context.
Sourcetype AddressIdsIter<'a>: Iterator<Item = Self::AddressId> + 'a
type AddressIdsIter<'a>: Iterator<Item = Self::AddressId> + 'a
The iterator given to with_address_ids
.
Required Methods§
Sourcefn with_ip_device_flags<O, F: FnOnce(&IpDeviceFlags) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O
fn with_ip_device_flags<O, F: FnOnce(&IpDeviceFlags) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O
Calls the function with immutable access to the device’s flags.
Note that this trait should only provide immutable access to the flags.
Changes to the IP device flags must only be performed while synchronizing
with the IP device configuration, so mutable access to the flags is through
WithIpDeviceConfigurationMutInner::with_configuration_and_flags_mut
.
Sourcefn add_ip_address(
&mut self,
device_id: &Self::DeviceId,
addr: AddrSubnet<I::Addr, I::AssignedWitness>,
config: I::AddressConfig<BT::Instant>,
) -> Result<Self::AddressId, ExistsError>
fn add_ip_address( &mut self, device_id: &Self::DeviceId, addr: AddrSubnet<I::Addr, I::AssignedWitness>, config: I::AddressConfig<BT::Instant>, ) -> Result<Self::AddressId, ExistsError>
Adds an IP address for the device.
Sourcefn remove_ip_address(
&mut self,
device_id: &Self::DeviceId,
addr: Self::AddressId,
) -> RemoveResourceResultWithContext<AddrSubnet<I::Addr>, BT>
fn remove_ip_address( &mut self, device_id: &Self::DeviceId, addr: Self::AddressId, ) -> RemoveResourceResultWithContext<AddrSubnet<I::Addr>, BT>
Removes an address from the device identified by the ID.
Sourcefn get_address_id(
&mut self,
device_id: &Self::DeviceId,
addr: SpecifiedAddr<I::Addr>,
) -> Result<Self::AddressId, NotFoundError>
fn get_address_id( &mut self, device_id: &Self::DeviceId, addr: SpecifiedAddr<I::Addr>, ) -> Result<Self::AddressId, NotFoundError>
Returns the address ID for the given address value.
Sourcefn with_address_ids<O, F: FnOnce(Self::AddressIdsIter<'_>, &mut Self::IpDeviceAddressCtx<'_>) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O
fn with_address_ids<O, F: FnOnce(Self::AddressIdsIter<'_>, &mut Self::IpDeviceAddressCtx<'_>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O
Calls the function with an iterator over all the address IDs associated with the device.
Sourcefn with_default_hop_limit<O, F: FnOnce(&NonZeroU8) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O
fn with_default_hop_limit<O, F: FnOnce(&NonZeroU8) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O
Calls the function with an immutable reference to the device’s default hop limit for this IP version.
Sourcefn with_default_hop_limit_mut<O, F: FnOnce(&mut NonZeroU8) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O
fn with_default_hop_limit_mut<O, F: FnOnce(&mut NonZeroU8) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O
Calls the function with a mutable reference to the device’s default hop limit for this IP version.
Sourcefn join_link_multicast_group(
&mut self,
bindings_ctx: &mut BT,
device_id: &Self::DeviceId,
multicast_addr: MulticastAddr<I::Addr>,
)
fn join_link_multicast_group( &mut self, bindings_ctx: &mut BT, device_id: &Self::DeviceId, multicast_addr: MulticastAddr<I::Addr>, )
Joins the link-layer multicast group associated with the given IP multicast group.
Sourcefn leave_link_multicast_group(
&mut self,
bindings_ctx: &mut BT,
device_id: &Self::DeviceId,
multicast_addr: MulticastAddr<I::Addr>,
)
fn leave_link_multicast_group( &mut self, bindings_ctx: &mut BT, device_id: &Self::DeviceId, multicast_addr: MulticastAddr<I::Addr>, )
Leaves the link-layer multicast group associated with the given IP multicast group.
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.