pub struct Bitmap<const SIZE: usize>where
    BitsImpl<{ SIZE }>: Bits,
{ /* private fields */ }
Expand description

A compact array of bits.

The type used to store the bitmap will be the minimum unsigned integer type required to fit the number of bits, from u8 to u128. If the size is 1, bool is used. If the size exceeds 128, an array of u128 will be used, sized as appropriately. The maximum supported size is currently 1024, represented by an array [u128; 8].

Implementations

Available with target feature sse2 only.
Available with target feature sse2 only.
Available with target feature avx only.
Available with target feature sse2 only.
Available with target feature avx only.
Available with target feature sse2 only.
Available with target feature avx only.
Available with target feature sse2 only.
Available with target feature avx only.

Construct a bitmap with every bit set to false.

Construct a bitmap where every bit with index less than bits is true, and every other bit is false.

Construct a bitmap from a value of the same type as its backing store.

Convert this bitmap into a value of the type of its backing store.

Get a reference to this bitmap’s backing store.

Count the number of true bits in the bitmap.

Test if the bitmap contains only false bits.

Test if the bitmap contains only true bits.

Get the value of the bit at a given index.

Set the value of the bit at a given index.

Returns the previous value of the bit.

Find the index of the first true bit in the bitmap.

Find the index of the last true bit in the bitmap.

Find the index of the first true bit in the bitmap after index.

Find the index of the last true bit in the bitmap before index.

Find the index of the first false bit in the bitmap.

Find the index of the last false bit in the bitmap.

Find the index of the first false bit in the bitmap after index.

Find the index of the first false bit in the bitmap before index.

Invert all the bits in the bitmap.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
The resulting type after applying the & operator.
Performs the & operation. Read more
Performs the &= operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
Performs the |= operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
Performs the ^= operation. Read more
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
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
The resulting type after applying the ! operator.
Performs the unary ! operation. Read more
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
Restrict a value to a certain interval. 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
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
The type returned in the event of a conversion error.
Performs the conversion.

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.