Skip to main content

HashMap

Type Alias HashMap 

Source
pub type HashMap<'arena, K, V, A, S = DefaultHashBuilder> = HashMap<K, V, S, &'arena A>;
Expand description

A hash map whose entries live in an arena.

The allocator slot is fixed to &'arena A, so construct it with hashbrown::HashMap::new_in (or with_capacity_in) and pass &arena:

let mut map: HashMap<u32, u32, SharedArena> = HashMap::new_in(&arena);

Aliased Type§

pub struct HashMap<'arena, K, V, A, S = DefaultHashBuilder> { /* private fields */ }

Trait Implementations§

Source§

impl<'arena, K, V, A, S> FromIteratorIn<(K, V)> for HashMap<'arena, K, V, A, S>
where K: Eq + Hash, S: BuildHasher + Default, A: Arena,

Source§

type Alloc = &'arena A

The allocator handle the collection is built into (e.g. &'arena A).
Source§

fn from_iter_in<I>(iter: I, alloc: Self::Alloc) -> Self
where I: IntoIterator<Item = (K, V)>,

Builds Self from iter, allocating into alloc.