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 Key {
First(bool),
Second,
}
let mut a = Set::new();
a.insert(Key::First(false));
assert!(!a.contains(Key::First(true)));
assert!(a.contains(Key::First(false)));
assert!(!a.contains(Key::Second));
assert!(a.iter().eq([Key::First(false)]));Iterator over boolean set:
use fixed_map::{Key, Set};
#[derive(Debug, Clone, Copy, PartialEq, Key)]
enum Key {
Bool(bool),
Other,
}
let mut a = Set::new();
a.insert(Key::Bool(true));
a.insert(Key::Bool(false));
assert!(a.iter().eq([Key::Bool(true), Key::Bool(false)]));
assert_eq!(a.iter().rev().collect::<Vec<_>>(), vec![Key::Bool(false), Key::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 ==.