Struct cranelift_egraph::CtxHashMap
source · pub struct CtxHashMap<K, V> { /* private fields */ }
Expand description
A HashMap that takes external context for all operations.
Implementations§
source§impl<K, V> CtxHashMap<K, V>
impl<K, V> CtxHashMap<K, V>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an empty hashmap with pre-allocated space for the given capacity.
source§impl<K, V> CtxHashMap<K, V>
impl<K, V> CtxHashMap<K, V>
sourcepub fn insert<Ctx: CtxEq<K, K> + CtxHash<K>>(
&mut self,
k: K,
v: V,
ctx: &Ctx,
uf: &mut UnionFind
) -> Option<V>
pub fn insert<Ctx: CtxEq<K, K> + CtxHash<K>>( &mut self, k: K, v: V, ctx: &Ctx, uf: &mut UnionFind ) -> Option<V>
Insert a new key-value pair, returning the old value associated with this key (if any).