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 MyKey {
First(u32),
Second,
}
let mut map = Set::new();
map.insert(MyKey::First(1));
assert_eq!(map.contains(MyKey::First(1)), true);
assert_eq!(map.contains(MyKey::First(2)), false);
assert_eq!(map.contains(MyKey::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 for HashbrownSetStorage<T>
impl<T> PartialEq for HashbrownSetStorage<T>
Source§impl<T> SetStorage<T> for HashbrownSetStorage<T>
impl<T> SetStorage<T> for HashbrownSetStorage<T>
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)
fn retain<F>(&mut self, func: F)
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
.impl<T> Eq for HashbrownSetStorage<T>
Auto Trait Implementations§
impl<T> Freeze for HashbrownSetStorage<T>
impl<T> RefUnwindSafe for HashbrownSetStorage<T>where
T: RefUnwindSafe,
impl<T> Send for HashbrownSetStorage<T>where
T: Send,
impl<T> Sync for HashbrownSetStorage<T>where
T: Sync,
impl<T> Unpin for HashbrownSetStorage<T>where
T: Unpin,
impl<T> UnwindSafe for HashbrownSetStorage<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more