use core::hash::Hash;
use allocator_api2::alloc::Allocator;
use hashbrown::{DefaultHashBuilder, HashMap, HashSet};
use super::Arena;
impl<A: Allocator + Clone> Arena<A> {
#[must_use]
#[inline]
pub fn alloc_hash_map<K, V>(&self) -> HashMap<K, V, DefaultHashBuilder, &Self> {
HashMap::new_in(self)
}
#[must_use]
#[inline]
pub fn alloc_hash_map_with_capacity<K, V>(&self, capacity: usize) -> HashMap<K, V, DefaultHashBuilder, &Self> {
HashMap::with_capacity_in(capacity, self)
}
#[must_use]
#[inline]
pub fn alloc_set<T: Hash + Eq>(&self) -> HashSet<T, DefaultHashBuilder, &Self> {
HashSet::new_in(self)
}
#[must_use]
#[inline]
pub fn alloc_set_with_capacity<T: Hash + Eq>(&self, capacity: usize) -> HashSet<T, DefaultHashBuilder, &Self> {
HashSet::with_capacity_in(capacity, self)
}
}