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
sourceimpl Clone for BooleanSetStorage
impl Clone for BooleanSetStorage
sourcefn clone(&self) -> BooleanSetStorage
fn clone(&self) -> BooleanSetStorage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl PartialEq<BooleanSetStorage> for BooleanSetStorage
impl PartialEq<BooleanSetStorage> for BooleanSetStorage
sourcefn eq(&self, other: &BooleanSetStorage) -> bool
fn eq(&self, other: &BooleanSetStorage) -> bool
sourceimpl SetStorage<bool> for BooleanSetStorage
impl SetStorage<bool> for BooleanSetStorage
type Iter<'this> = Iter
type Iter<'this> = Iter
Immutable iterator over storage.
type IntoIter = Iter
type IntoIter = Iter
Owning iterator over the storage.
sourcefn insert(&mut self, value: bool) -> bool
fn insert(&mut self, value: bool) -> bool
This is the storage abstraction for
Set::insert
.sourcefn contains(&self, value: bool) -> bool
fn contains(&self, value: bool) -> bool
This is the storage abstraction for
Set::contains
.sourcefn remove(&mut self, value: bool) -> bool
fn remove(&mut self, value: bool) -> bool
This is the storage abstraction for
Set::remove
.sourcefn retain<F>(&mut self, f: F)where
F: FnMut(bool) -> bool,
fn retain<F>(&mut self, f: F)where
F: FnMut(bool) -> bool,
This is the storage abstraction for
Set::retain
.sourcefn clear(&mut self)
fn clear(&mut self)
This is the storage abstraction for
Set::clear
.sourcefn into_iter(self) -> Self::IntoIter
fn into_iter(self) -> Self::IntoIter
This is the storage abstraction for
Set::into_iter
.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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more