Open addressing with linear probing.

Const INITIAL_CAPACITY

uint

Enum SearchResult

Variants

Struct Bucket

struct Bucket <K: Eq Hash, V>{
    hash: uint,
    key: K,
    value: V,
}

Struct LinearMap

pub struct LinearMap <K: Eq Hash, V>{
    k0: u64,
    k1: u64,
    resize_at: uint,
    size: uint,
    buckets: ~[Option<Bucket<K, V>>],
}

Implementation for LinearMap<K, V>

Method to_bucket

fn to_bucket(h: uint) -> uint

Method next_bucket

fn next_bucket(idx: uint, len_buckets: uint) -> uint

Method bucket_sequence

fn bucket_sequence(hash: uint, op: &fn(uint) -> bool) -> uint

Method bucket_for_key

fn bucket_for_key(buckets: &[Option<Bucket<K, V>>], k: &K) -> SearchResult

Method bucket_for_key_with_hash

fn bucket_for_key_with_hash(buckets: &[Option<Bucket<K, V>>], hash: uint,
                            k: &K) -> SearchResult

Method expand

fn expand()

Expands the capacity of the array and re-inserts each of the existing buckets.

Method insert_opt_bucket

fn insert_opt_bucket(bucket: Option<Bucket<K, V>>)

Method insert_internal

fn insert_internal(hash: uint, k: K, v: V) -> bool

Inserts the key value pair into the buckets. Assumes that there will be a bucket. True if there was no previous entry with that key

Method pop_internal

fn pop_internal(hash: uint, k: &K) -> Option<V>

Implementation for LinearMap<K, V>

Method insert

fn insert(k: K, v: V) -> bool

Method remove

fn remove(k: &K) -> bool

Method pop

fn pop(k: &K) -> Option<V>

Method swap

fn swap(k: K, v: V) -> Option<V>

Method consume

fn consume(f: &fn(K, V))

Method clear

fn clear()

Method len

fn len() -> uint

Method is_empty

fn is_empty() -> bool

Method contains_key

fn contains_key(k: &K) -> bool

Method find_ref

fn find_ref(k: &K) -> Option<&self /V>

Method get_ref

fn get_ref(k: &K) -> &self /V

Method each

fn each(blk: &fn(k: &K, v: &V) -> bool)

Method each_key

fn each_key(blk: &fn(k: &K) -> bool)

Method each_value

fn each_value(blk: &fn(v: &V) -> bool)

Implementation for LinearMap<K, V>

Method find

fn find(k: &K) -> Option<V>

Method get

fn get(k: &K) -> V

Implementation of cmp::Eq for LinearMap<K, V>

Method eq

fn eq(other: &LinearMap<K, V>) -> bool

Method ne

fn ne(other: &LinearMap<K, V>) -> bool

Function LinearMap

fn LinearMap<K: Eq Hash, V>() -> LinearMap<K, V>

Function linear_map_with_capacity

fn linear_map_with_capacity<K: Eq Hash, V>(initial_capacity: uint) ->
 LinearMap<K, V>

Function linear_map_with_capacity_and_keys

fn linear_map_with_capacity_and_keys<K: Eq Hash,
                                     V>(k0: u64, k1: u64,
                                        initial_capacity: uint) ->
 LinearMap<K, V>

Function resize_at

fn resize_at(capacity: uint) -> uint