pub struct NeighborCache<'d> { /* private fields */ }Expand description
The stack’s neighbor cache, returned by Stack::neighbor_cache.
Implementations§
Source§impl<'d> NeighborCache<'d>
impl<'d> NeighborCache<'d>
Sourcepub fn get(&self, iface: IfaceHandle, addr: IpAddress) -> Option<Neighbor>
pub fn get(&self, iface: IfaceHandle, addr: IpAddress) -> Option<Neighbor>
Look up a neighbor by interface and IP address.
Sourcepub fn iter(&self) -> impl Iterator<Item = Neighbor> + 'd
pub fn iter(&self) -> impl Iterator<Item = Neighbor> + 'd
Iterate over the neighbors in the cache.
Sourcepub fn insert(
&self,
iface: IfaceHandle,
addr: IpAddress,
hardware_addr: HardwareAddress,
expires_at: Instant,
)
pub fn insert( &self, iface: IfaceHandle, addr: IpAddress, hardware_addr: HardwareAddress, expires_at: Instant, )
Insert a neighbor, replacing any entry for the same interface and address.
Sourcepub fn remove(&self, iface: IfaceHandle, addr: IpAddress) -> Option<Neighbor>
pub fn remove(&self, iface: IfaceHandle, addr: IpAddress) -> Option<Neighbor>
Remove a neighbor, returning it.
Sourcepub fn retain(&self, f: impl FnMut(&Neighbor) -> bool)
pub fn retain(&self, f: impl FnMut(&Neighbor) -> bool)
Keep only the neighbors f returns true for.
Sourcepub fn clear_iface(&self, iface: IfaceHandle)
pub fn clear_iface(&self, iface: IfaceHandle)
Remove every neighbor on one interface.
Trait Implementations§
Source§impl<'d> Clone for NeighborCache<'d>
impl<'d> Clone for NeighborCache<'d>
Source§fn clone(&self) -> NeighborCache<'d>
fn clone(&self) -> NeighborCache<'d>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'d> Copy for NeighborCache<'d>
Auto Trait Implementations§
impl<'d> !RefUnwindSafe for NeighborCache<'d>
impl<'d> !Send for NeighborCache<'d>
impl<'d> !Sync for NeighborCache<'d>
impl<'d> !UnwindSafe for NeighborCache<'d>
impl<'d> Freeze for NeighborCache<'d>
impl<'d> Unpin for NeighborCache<'d>
impl<'d> UnsafeUnpin for NeighborCache<'d>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more