pub trait SlaacAddresses<BT: SlaacBindingsTypes> {
type AddrsIter<'x>: Iterator<Item = SlaacAddressEntry<BT::Instant>>;
// Required methods
fn for_each_addr_mut<F: FnMut(SlaacAddressEntryMut<'_, BT::Instant>)>(
&mut self,
cb: F,
);
fn with_addrs<O, F: FnOnce(Self::AddrsIter<'_>) -> O>(&mut self, cb: F) -> O;
fn add_addr_sub_and_then<O, F: FnOnce(SlaacAddressEntryMut<'_, BT::Instant>, &mut BT) -> O>(
&mut self,
bindings_ctx: &mut BT,
addr_sub: AddrSubnet<Ipv6Addr, Ipv6DeviceAddr>,
config: Ipv6AddrSlaacConfig<BT::Instant>,
and_then: F,
) -> Result<O, ExistsError>;
fn remove_addr(
&mut self,
bindings_ctx: &mut BT,
addr: &Ipv6DeviceAddr,
) -> Result<(AddrSubnet<Ipv6Addr, Ipv6DeviceAddr>, SlaacConfig<BT::Instant>), NotFoundError>;
}
Expand description
Abstracts iteration over a device’s SLAAC addresses.
Required Associated Types§
Sourcetype AddrsIter<'x>: Iterator<Item = SlaacAddressEntry<BT::Instant>>
type AddrsIter<'x>: Iterator<Item = SlaacAddressEntry<BT::Instant>>
The iterator provided to with_addrs
.
Required Methods§
Sourcefn for_each_addr_mut<F: FnMut(SlaacAddressEntryMut<'_, BT::Instant>)>(
&mut self,
cb: F,
)
fn for_each_addr_mut<F: FnMut(SlaacAddressEntryMut<'_, BT::Instant>)>( &mut self, cb: F, )
Returns an iterator providing a mutable view of mutable SLAAC address state.
Sourcefn with_addrs<O, F: FnOnce(Self::AddrsIter<'_>) -> O>(&mut self, cb: F) -> O
fn with_addrs<O, F: FnOnce(Self::AddrsIter<'_>) -> O>(&mut self, cb: F) -> O
Calls the callback with an iterator over the addresses.
Sourcefn add_addr_sub_and_then<O, F: FnOnce(SlaacAddressEntryMut<'_, BT::Instant>, &mut BT) -> O>(
&mut self,
bindings_ctx: &mut BT,
addr_sub: AddrSubnet<Ipv6Addr, Ipv6DeviceAddr>,
config: Ipv6AddrSlaacConfig<BT::Instant>,
and_then: F,
) -> Result<O, ExistsError>
fn add_addr_sub_and_then<O, F: FnOnce(SlaacAddressEntryMut<'_, BT::Instant>, &mut BT) -> O>( &mut self, bindings_ctx: &mut BT, addr_sub: AddrSubnet<Ipv6Addr, Ipv6DeviceAddr>, config: Ipv6AddrSlaacConfig<BT::Instant>, and_then: F, ) -> Result<O, ExistsError>
Adds addr_sub
with config
to the device and calls and_then
with
the newly added entry.
Sourcefn remove_addr(
&mut self,
bindings_ctx: &mut BT,
addr: &Ipv6DeviceAddr,
) -> Result<(AddrSubnet<Ipv6Addr, Ipv6DeviceAddr>, SlaacConfig<BT::Instant>), NotFoundError>
fn remove_addr( &mut self, bindings_ctx: &mut BT, addr: &Ipv6DeviceAddr, ) -> Result<(AddrSubnet<Ipv6Addr, Ipv6DeviceAddr>, SlaacConfig<BT::Instant>), NotFoundError>
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.