Struct concache::crossbeam::MapHandle [−][src]
pub struct MapHandle<K, V> { /* fields omitted */ }
A handle to a shared Map
.
Any operation performed on this handle affects the map seen by all other related MapHandle
instances. To get another handle to the Map
, simply clone any of its handles.
Methods
impl<K, V> MapHandle<K, V>
[src]
impl<K, V> MapHandle<K, V>
pub fn with_capacity(nbuckets: usize) -> Self
[src]
pub fn with_capacity(nbuckets: usize) -> Self
Create a new, shared map and return a handle to it.
The map will have nbuckets
buckets to distribute stored keys among. If there are many
more keys than buckets, performance will suffer, as all the keys in a key's bucket must be
searched to read or update that key.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of elements in the map.
Examples
use concache::crossbeam::Map; let mut a = Map::with_capacity(16); assert_eq!(a.len(), 0); a.insert(1, "a"); assert_eq!(a.len(), 1);
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true if the map contains no elements.
Examples
use concache::crossbeam::Map; let mut a = Map::with_capacity(16); assert!(a.is_empty()); a.insert(1, "a"); assert!(!a.is_empty());