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
Source§fn clone(&self) -> BooleanSetStorage
fn clone(&self) -> BooleanSetStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BooleanSetStorage
impl Eq for BooleanSetStorage
Source§impl PartialEq for BooleanSetStorage
impl PartialEq for BooleanSetStorage
Source§fn eq(&self, other: &BooleanSetStorage) -> bool
fn eq(&self, other: &BooleanSetStorage) -> bool
Tests for
self and other values to be equal, and is used by ==.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