Trait succinct::bit_vector::BitVector [] [src]

pub trait BitVector: BitsMut {
    fn push_bit(&mut self, value: bool);
    fn pop_bit(&mut self) -> Option<bool>;

    fn align_block(&mut self, value: bool) { ... }
    fn push_block(&mut self, value: Self::Block) { ... }
}

Interface for full bit vector operations.

Required Methods

fn push_bit(&mut self, value: bool)

Adds the given bit to the end of the bit vector.

fn pop_bit(&mut self) -> Option<bool>

Removes and returns the last bit, if any.

Provided Methods

fn align_block(&mut self, value: bool)

Pushes value 0 or more times until the size of the bit vector is block-aligned.

fn push_block(&mut self, value: Self::Block)

Pushes the given block onto the end of the bit vector.

If the end of the bit vector is not currently block-aligned, it pads with 0s up to the next block before pushing.

The default implementation pushes the block one bit at a time; override it with something more efficient.

Implementors