Skip to main content

FastHashMap

Type Alias FastHashMap 

Source
pub type FastHashMap = HashMap<usize, Entry, RandomState>;
Expand description

HashMap with ahash for faster hashing (not DOS-resistant).

Uses ahash instead of SipHash for improved throughput. Not DOS-resistant, suitable for local, non-hostile environments.

Aliased Type§

pub struct FastHashMap { /* private fields */ }

Trait Implementations§

Source§

impl MapStorage for FastHashMap

Source§

fn decrement_and_maybe_remove(&mut self, key: &usize) -> Option<(bool, usize)>

Entry-based decrement for single-lookup performance.

Source§

fn get(&self, key: &usize) -> Option<&Entry>

Get an entry by key.
Source§

fn get_mut(&mut self, key: &usize) -> Option<&mut Entry>

Get a mutable entry by key.
Source§

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

Insert an entry, returning the old value if present.
Source§

fn remove(&mut self, key: &usize) -> Option<Entry>

Remove an entry by key.
Source§

fn contains_key(&self, key: &usize) -> bool

Check if a key exists.
Source§

fn for_each_entry<F: FnMut(&Entry)>(&self, f: F)

Iterate over all entries.
Source§

fn clear(&mut self)

Clear all entries.
Source§

fn reserve(&mut self, additional: usize)

Reserve capacity for additional entries. Read more