A simple map based on a vector for small integer keys. Space requirements are O(highest integer key).

Type SmallIntMap_

type SmallIntMap_<T: Copy> = {v: DVec<Option<T>>,}

Enum SmallIntMap

Variants

Implementation of map::Map<uint, V> for SmallIntMap<V>

Implements the map::map interface for smallintmap

Method size

fn size() -> uint

Method insert

fn insert(key: uint, value: V) -> bool

Method remove

fn remove(key: uint) -> bool

Method clear

fn clear()

Method contains_key

fn contains_key(key: uint) -> bool

Method contains_key_ref

fn contains_key_ref(key: & uint) -> bool

Method get

fn get(key: uint) -> V

Method find

fn find(key: uint) -> Option<V>

Method rehash

fn rehash()

Method each

fn each(it: fn&(key: uint, value: V) -> bool)

Method each_key

fn each_key(it: fn&(key: uint) -> bool)

Method each_value

fn each_value(it: fn&(value: V) -> bool)

Method each_ref

fn each_ref(it: fn&(key: & uint, value: & V) -> bool)

Method each_key_ref

fn each_key_ref(blk: fn&(key: & uint) -> bool)

Method each_value_ref

fn each_value_ref(blk: fn&(value: & V) -> bool)

Implementation of ops::Index<uint, V> for SmallIntMap<V>

Method index

fn index(key: uint) -> V

Function as_map

fn as_map<V: Copy>(s: SmallIntMap<V>) -> map::Map<uint, V>

Cast the given smallintmap to a map::map

Function contains_key

fn contains_key<T: Copy>(self: SmallIntMap<T>, key: uint) -> bool

Returns true if the map contains a value for the specified key

Function find

fn find<T: Copy>(self: SmallIntMap<T>, key: uint) -> Option<T>

Get the value for the specified key. If the key does not exist in the map then returns none

Function get

fn get<T: Copy>(self: SmallIntMap<T>, key: uint) -> T

Get the value for the specified key

Failure

If the key does not exist in the map

Function insert

fn insert<T: Copy>(self: SmallIntMap<T>, key: uint, val: T)

Add a value to the map. If the map already contains a value for the specified key then the original value is replaced.

Function mk

fn mk<T: Copy>() -> SmallIntMap<T>

Create a smallintmap