Trait ccache::hashmap::HashMap[][src]

pub trait HashMap<Entry, Key, Val, Cid, Umeta, BuildHasher> where
    Entry: EntryT<Key, Val, Cid, Umeta>,
    Key: Hash,
    Val: Val,
    Cid: Cid,
    Umeta: Meta<Val>,
    BuildHasher: BuildHasher
{
Show methods fn with_capacity(capacity: usize) -> Self;
fn with_capacity_and_hasher(
        capacity: usize,
        hash_builder: BuildHasher
    ) -> Self;
fn capacity(&self) -> usize;
fn len(&self) -> usize;
fn get_full(&self, key: &Key) -> Option<(usize, &Entry)>;
fn get_full_mut(&mut self, key: &Key) -> Option<(usize, &mut Entry)>;
fn get_index(&self, idx: usize) -> Option<&Entry>;
fn get_index_mut(&mut self, idx: usize) -> Option<&mut Entry>;
unsafe fn index_from_entry(&self, e: &Entry) -> usize;
fn remove(&mut self, item: &Entry) -> Entry;
fn remove_idx(&mut self, idx: usize) -> Entry;
fn clear(&mut self);
fn insert(&mut self, entry: Entry) -> (Option<Entry>, usize, &Entry);
fn insert_mut(&mut self, entry: Entry) -> (Option<Entry>, usize, &mut Entry);
fn hasher(&self) -> &BuildHasher;
}

Trait to reimplement to use an hashmap with ccache

Required methods

fn with_capacity(capacity: usize) -> Self[src]

Construct an Hashmap with the given capacity

fn with_capacity_and_hasher(capacity: usize, hash_builder: BuildHasher) -> Self[src]

Construct an Hashmap with the given capacity and hash builder

fn capacity(&self) -> usize[src]

return the current hashmap max capacity

fn len(&self) -> usize[src]

Returns the current number of elements in the hashmap

fn get_full(&self, key: &Key) -> Option<(usize, &Entry)>[src]

Get the index and the reference to an element if present

fn get_full_mut(&mut self, key: &Key) -> Option<(usize, &mut Entry)>[src]

Get the index and a mutable reference to an element if present

fn get_index(&self, idx: usize) -> Option<&Entry>[src]

Return a reference to the object at the given index, if any

fn get_index_mut(&mut self, idx: usize) -> Option<&mut Entry>[src]

Return a reference to the object at the given index, if any

unsafe fn index_from_entry(&self, e: &Entry) -> usize[src]

Get a ref to an Entry and translate it to an index

fn remove(&mut self, item: &Entry) -> Entry[src]

Remove and ojbect. Returns the removed object Must not reshuffle after removal

fn remove_idx(&mut self, idx: usize) -> Entry[src]

Remove and ojbect at idx. Returns the removed object If no object was present, return a default object Must not reshuffle after removal

fn clear(&mut self)[src]

Remove all objects in the hashmap

fn insert(&mut self, entry: Entry) -> (Option<Entry>, usize, &Entry)[src]

Insert a new element in the hashmap. Returns a pair with a possible clash Option<V> plus the index and the reference to the object just inserted Must not reshuffle or reallocate

fn insert_mut(&mut self, entry: Entry) -> (Option<Entry>, usize, &mut Entry)[src]

Insert a new element in the hashmap. Returns a pair with a possible clash Option<V> plus the index and the mutable reference to the object just inserted Must not reshuffle or reallocate

fn hasher(&self) -> &BuildHasher[src]

returns a reference to the current hasher

Loading content...

Implementors

impl<Entry, Key, Val, Cid, Umeta, BuildHasher> HashMap<Entry, Key, Val, Cid, Umeta, BuildHasher> for SimpleHmap<Entry, Key, Val, Cid, Umeta, BuildHasher> where
    Entry: EntryT<Key, Val, Cid, Umeta>,
    Key: Hash,
    Val: Val,
    Cid: Cid,
    Umeta: Meta<Val>,
    BuildHasher: BuildHasher + Default
[src]

Loading content...