Struct fixed_map::set::storage::BooleanSetStorage
source · 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 copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl PartialEq<BooleanSetStorage> for BooleanSetStorage
impl PartialEq<BooleanSetStorage> for BooleanSetStorage
source§fn eq(&self, other: &BooleanSetStorage) -> bool
fn eq(&self, other: &BooleanSetStorage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl SetStorage<bool> for BooleanSetStorage
impl SetStorage<bool> for BooleanSetStorage
impl Copy for BooleanSetStorage
impl Eq for BooleanSetStorage
impl StructuralEq for BooleanSetStorage
impl StructuralPartialEq for BooleanSetStorage
Auto Trait Implementations§
impl RefUnwindSafe for BooleanSetStorage
impl Send for BooleanSetStorage
impl Sync for BooleanSetStorage
impl Unpin 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