pub struct StaticBitSet<const N: usize> { /* private fields */ }

Implementations

Clears the set, removing all values.

Inserts bit into the set.

Panics

Panics if ‘bit’ is beyond the bounds of the StaticBitSet.

Returns the number of elements in the set.

Returns the number of elements missing from the set.

Returns true if the set contains no elements.

Returns true if the set is a subset of another, i.e. other contains at least all the values in self.

Returns true if the set is a subset of another, i.e. self contains at least all the values in other.

Returns true if self has no elements in common with other. This is equivalent to checking for an empty intersection.

Populates the union, i.e. all the values in self or other, without duplicates.

use staticbitset::StaticBitSet;
let mut a = StaticBitSet::<64>::default();
let mut b = StaticBitSet::<64>::default();
let mut c = StaticBitSet::<64>::default();
a.insert(3);
a.insert(2);
b.insert(1);
b.insert(4);
a.union(&b, &mut c);
assert_eq!(c.ones().collect::<Vec<usize>>(), [1,2,3,4]);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 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.