Module std::bit_vector
Struct BitVector
public struct BitVector has copy, drop, store
Constants
The provided index is out of bounds
An invalid length of bitvector was given
The maximum allowed bitvector size
Function new
public fun new(length: u64): std::bit_vector::BitVector
Function set
Set the bit at bit_index in the bitvector regardless of its previous state.
public fun set(bitvector: &mut std::bit_vector::BitVector, bit_index: u64)
Function unset
Unset the bit at bit_index in the bitvector regardless of its previous state.
public fun unset(bitvector: &mut std::bit_vector::BitVector, bit_index: u64)
Function shift_left
Shift the bitvector left by amount. If amount is greater than the bitvector's length the bitvector will be zeroed out.
public fun shift_left(bitvector: &mut std::bit_vector::BitVector, amount: u64)
Function is_index_set
Return the value of the bit at bit_index in the bitvector. true represents "1" and false represents a 0
public fun is_index_set(bitvector: &std::bit_vector::BitVector, bit_index: u64): bool
Function length
Return the length (number of usable bits) of this bitvector
public fun length(bitvector: &std::bit_vector::BitVector): u64
Function longest_set_sequence_starting_at
Returns the length of the longest sequence of set bits starting at (and including) start_index in the bitvector. If there is no such sequence, then 0 is returned.
public fun longest_set_sequence_starting_at(bitvector: &std::bit_vector::BitVector, start_index: u64): u64