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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Immutable iterator over storage.
Owning iterator over the storage.
Construct empty storage.
Get the length of storage.
Check if storage is empty.
This is the storage abstraction for Set::insert.
This is the storage abstraction for Set::contains.
This is the storage abstraction for Set::remove.
This is the storage abstraction for Set::retain.
This is the storage abstraction for Set::clear.
This is the storage abstraction for Set::iter.
This is the storage abstraction for Set::into_iter.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.