pub struct NeighborCache<'a> { /* private fields */ }
Expand description

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[..]);

Implementations

Create a cache. The backing storage is cleared upon creation.

Panics

This function panics if storage.len() == 0.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.