Struct fixedbitset::FixedBitSet [] [src]

pub struct FixedBitSet { /* fields omitted */ }

FixedBitSet is a simple fixed size set of bits that each can be enabled (1 / true) or disabled (0 / false).

The bit set has a fixed capacity in terms of enabling bits (and the capacity can grow using the grow method).

Methods

impl FixedBitSet
[src]

Create a new FixedBitSet with a specific number of bits, all initially clear.

Grow capacity to bits, all new bits initialized to zero

Return the length of the FixedBitSet in bits.

Return true if the bit is enabled in the FixedBitSet, false otherwise.

Note: bits outside the capacity are always disabled.

Note: Also available with index syntax: bitset[bit].

Clear all bits.

Enable bit.

Panics if bit is out of bounds.

Enable bit, and return its previous value.

Panics if bit is out of bounds.

Panics if bit is out of bounds.

Copies boolean value from specified bit to the specified bit.

Panics if to is out of bounds.

Count the number of set bits in the given bit range.

Use .. to count the whole content of the bitset.

Panics if the range extends past the end of the bitset.

Sets every bit in the given range to the given state (enabled)

Use .. to toggle the whole bitset.

Panics if the range extends past the end of the bitset.

Enables every bit in the given range.

Use .. to make the whole bitset ones.

Panics if the range extends past the end of the bitset.

View the bitset as a slice of u32 blocks

View the bitset as a mutable slice of u32 blocks. Writing past the bitlength in the last will cause contains to return potentially incorrect results for bits past the bitlength.

Important traits for Ones<'a>

Iterates over all enabled bits.

Iterator element is the index of the 1 bit, type usize.

Important traits for Intersection<'a>

Returns a lazy iterator over the intersection of two FixedBitSets

Important traits for Union<'a>

Returns a lazy iterator over the union of two FixedBitSets.

Important traits for Difference<'a>

Returns a lazy iterator over the difference of two FixedBitSets. The difference of a and b is the elements of a which are not in b.

Trait Implementations

impl Debug for FixedBitSet
[src]

Formats the value using the given formatter. Read more

impl PartialEq for FixedBitSet
[src]

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

This method tests for !=.

impl Eq for FixedBitSet
[src]

impl PartialOrd for FixedBitSet
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for FixedBitSet
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Hash for FixedBitSet
[src]

Feeds this value into the given [Hasher]. Read more

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

impl Default for FixedBitSet
[src]

Returns the "default value" for a type. Read more

impl Clone for FixedBitSet
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Index<usize> for FixedBitSet
[src]

Return true if the bit is enabled in the bitset, or false otherwise.

Note: bits outside the capacity are always disabled, and thus indexing a FixedBitSet will not panic.

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl Extend<usize> for FixedBitSet
[src]

Sets the bit at index i to true for each item i in the input src.

Extends a collection with the contents of an iterator. Read more

impl FromIterator<usize> for FixedBitSet
[src]

Return a FixedBitSet containing bits set to true for every bit index in the iterator, other bits are set to false.

Creates a value from an iterator. Read more

impl<'a> BitAnd for &'a FixedBitSet
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<'a> BitOr for &'a FixedBitSet
[src]

The resulting type after applying the | operator.

Performs the | operation.

Auto Trait Implementations

impl Send for FixedBitSet

impl Sync for FixedBitSet