pub struct BooleanSetStorage { /* private fields */ }Expand description
SetStorage for bool types.
§Examples
use fixed_map::{Key, Set};
#[derive(Debug, Clone, Copy, PartialEq, Key)]
enum MyKey {
First(bool),
Second,
}
let mut a = Set::new();
a.insert(MyKey::First(false));
assert!(!a.contains(MyKey::First(true)));
assert!(a.contains(MyKey::First(false)));
assert!(!a.contains(MyKey::Second));
assert!(a.iter().eq([MyKey::First(false)]));Iterator over boolean set:
use fixed_map::{Key, Set};
#[derive(Debug, Clone, Copy, PartialEq, Key)]
enum MyKey {
Bool(bool),
Other,
}
let mut a = Set::new();
a.insert(MyKey::Bool(true));
a.insert(MyKey::Bool(false));
assert!(a.iter().eq([MyKey::Bool(true), MyKey::Bool(false)]));
assert_eq!(a.iter().rev().collect::<Vec<_>>(), vec![MyKey::Bool(false), MyKey::Bool(true)]);Trait Implementations§
Source§impl Clone for BooleanSetStorage
impl Clone for BooleanSetStorage
impl Copy for BooleanSetStorage
impl Eq for BooleanSetStorage
Source§impl PartialEq for BooleanSetStorage
impl PartialEq for BooleanSetStorage
Source§impl SetStorage<bool> for BooleanSetStorage
impl SetStorage<bool> for BooleanSetStorage
Source§fn retain<F>(&mut self, f: F)
fn retain<F>(&mut self, f: 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 StructuralPartialEq for BooleanSetStorage
Auto Trait Implementations§
impl Freeze for BooleanSetStorage
impl RefUnwindSafe for BooleanSetStorage
impl Send for BooleanSetStorage
impl Sync for BooleanSetStorage
impl Unpin for BooleanSetStorage
impl UnsafeUnpin for BooleanSetStorage
impl UnwindSafe for BooleanSetStorage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.