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]

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.

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);

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());

Trait Implementations

impl<K: Clone, V: Clone> Clone for MapHandle<K, V>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<K, V> Send for MapHandle<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Sync for MapHandle<K, V> where
    K: Sync,
    V: Sync