[−][src]Struct smoltcp::iface::NeighborCache
A neighbor cache backed by a map.
Examples
On systems with heap, this cache can be created with:
use std::collections::BTreeMap; use smoltcp::iface::NeighborCache; let mut neighbor_cache = NeighborCache::new(BTreeMap::new());
On systems without heap, use:
use smoltcp::iface::NeighborCache; let mut neighbor_cache_storage = [None; 8]; let mut neighbor_cache = NeighborCache::new(&mut neighbor_cache_storage[..]);
Methods
impl<'a> Cache<'a>
[src]
pub fn new<T>(storage: T) -> Cache<'a> where
T: Into<ManagedMap<'a, IpAddress, Neighbor>>,
[src]
T: Into<ManagedMap<'a, IpAddress, Neighbor>>,
Create a cache. The backing storage is cleared upon creation.
Panics
This function panics if storage.len() == 0
.
pub fn new_with_limit<T>(storage: T, gc_threshold: usize) -> Cache<'a> where
T: Into<ManagedMap<'a, IpAddress, Neighbor>>,
[src]
T: Into<ManagedMap<'a, IpAddress, Neighbor>>,
pub fn fill(
&mut self,
protocol_addr: IpAddress,
hardware_addr: EthernetAddress,
timestamp: Instant
)
[src]
&mut self,
protocol_addr: IpAddress,
hardware_addr: EthernetAddress,
timestamp: Instant
)
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Cache<'a>
impl<'a> Send for Cache<'a>
impl<'a> Sync for Cache<'a>
impl<'a> Unpin for Cache<'a>
impl<'a> !UnwindSafe for Cache<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,