Struct fixed_map::set::storage::HashbrownSetStorage
source · #[repr(transparent)]pub struct HashbrownSetStorage<T> { /* private fields */ }Expand description
SetStorage for dynamically stored types, using hashbrown::HashSet.
This allows for dynamic types such as &'static str or u32 to be used as
a Key.
Examples
use fixed_map::{Key, Set};
#[derive(Clone, Copy, Key)]
enum Key {
First(u32),
Second,
}
let mut map = Set::new();
map.insert(Key::First(1));
assert_eq!(map.contains(Key::First(1)), true);
assert_eq!(map.contains(Key::First(2)), false);
assert_eq!(map.contains(Key::Second), false);Trait Implementations§
source§impl<T> Clone for HashbrownSetStorage<T>where
T: Clone,
impl<T> Clone for HashbrownSetStorage<T>where T: Clone,
source§impl<T> PartialEq<HashbrownSetStorage<T>> for HashbrownSetStorage<T>where
T: Eq + Hash,
impl<T> PartialEq<HashbrownSetStorage<T>> for HashbrownSetStorage<T>where T: Eq + Hash,
source§impl<T> SetStorage<T> for HashbrownSetStorage<T>where
T: Copy + Eq + Hash,
impl<T> SetStorage<T> for HashbrownSetStorage<T>where T: Copy + Eq + Hash,
source§fn insert(&mut self, value: T) -> bool
fn insert(&mut self, value: T) -> bool
This is the storage abstraction for
Set::insert.source§fn contains(&self, value: T) -> bool
fn contains(&self, value: T) -> bool
This is the storage abstraction for
Set::contains.source§fn remove(&mut self, value: T) -> bool
fn remove(&mut self, value: T) -> bool
This is the storage abstraction for
Set::remove.source§fn retain<F>(&mut self, func: F)where
F: FnMut(T) -> bool,
fn retain<F>(&mut self, func: F)where F: FnMut(T) -> bool,
This is the storage abstraction for
Set::retain.source§fn clear(&mut self)
fn clear(&mut self)
This is the storage abstraction for
Set::clear.source§fn into_iter(self) -> Self::IntoIter
fn into_iter(self) -> Self::IntoIter
This is the storage abstraction for
Set::into_iter.