Struct intmap::IntMap [] [src]

pub struct IntMap<V> { /* fields omitted */ }

Methods

impl<V> IntMap<V>
[src]

Creates a new IntMap.

Examples

use intmap::IntMap;

let mut map: IntMap<u64> = IntMap::new();

Creates a new IntMap with a at least capacity, all sizes is a power of 2.

Examples

use intmap::IntMap;

let mut map: IntMap<u64> = IntMap::with_capacity(20);

Insert key/value into the IntMap.

Examples

use intmap::IntMap;

let mut map = IntMap::new();
map.insert(21, "Eat my shorts");

Get value from the IntMap.

Examples

use intmap::IntMap;

let mut map: IntMap<u64> = IntMap::new();
map.insert(21, 42);
let val = map.get(21);
assert!(val.is_some());
assert_eq!(*val.unwrap(), 42);
assert!(map.contains_key(21));

Remove value from the IntMap.

Examples

use intmap::IntMap;

let mut map: IntMap<u64> = IntMap::new();
map.insert(21, 42);
let val = map.remove(21);
assert!(val.is_some());
assert_eq!(val.unwrap(), 42);
assert!(!map.contains_key(21));

Returns true if key is in map.

Examples

use intmap::IntMap;

let mut map: IntMap<u64> = IntMap::new();
map.insert(21, 42);
assert!(map.contains_key(21));

Removes all elements from map.

Number of elements in map.

Number of slots filled.

Total number of slots available.