DoxigAlpha

Self

A bit set with runtime-known size, backed by an allocated slice of usize. The allocator must be tracked externally by the user.

Fields of this type

Fields

#
bit_length:usize
The number of valid items in this bit set
masks:[*]MaskInt
The bit masks, ordered with lower indices first.

Creates a bit set with no elements present.

Functions

#
initEmpty
Creates a bit set with no elements present.
initFull
Creates a bit set with all elements present.
resize
Resizes to a new bit_length.
deinit
Deinitializes the array and releases its memory.
clone
Creates a duplicate of this bit set, using the new allocator.
capacity
Returns the number of bits in this bit set
isSet
Returns true if the bit at the specified index
count
Returns the total number of set bits in this bit set.
setValue
Changes the value of the specified bit of the bit
set
Adds a specific bit to the bit set
setRangeValue
Changes the value of all bits in the specified range to
unset
Removes a specific bit from the bit set
unsetAll
Set all bits to 0.
setAll
Set all bits to 1.
toggle
Flips a specific bit in the bit set
toggleSet
Flips all bits in this bit set which are present
toggleAll
Flips every bit in the bit set.
setUnion
Performs a union of two bit sets, and stores the
setIntersection
Performs an intersection of two bit sets, and stores
findFirstSet
Finds the index of the first set bit.
findLastSet
Finds the index of the last set bit.
toggleFirstSet
Finds the index of the first set bit, and unsets it.
eql
Returns true iff every corresponding bit in both
subsetOf
Returns true iff the first bit set is the subset
supersetOf
Returns true iff the first bit set is the superset
iterator
Iterates through the items in the set, according to the options.