[][src]Trait succinct::BitVec

pub trait BitVec {
    type Block: BlockType;
    fn bit_len(&self) -> u64;

    fn block_len(&self) -> usize { ... }
fn get_bit(&self, position: u64) -> bool { ... }
fn get_block(&self, position: usize) -> Self::Block { ... }
fn get_bits(&self, start: u64, count: usize) -> Self::Block { ... } }

Read-only bit vector operations.

Minimal complete definition is get_bit or get_block, since each is defined in terms of the other. Note that get_block in terms of get_bit is inefficient, and thus you should implement get_block directly if possible.

Associated Types

type Block: BlockType

The underlying block type used to store the bits of the vector.

Loading content...

Required methods

fn bit_len(&self) -> u64

The length of the slice in bits.

Loading content...

Provided methods

fn block_len(&self) -> usize

The length of the slice in blocks.

fn get_bit(&self, position: u64) -> bool

Gets the bit at position

The default implementation calls get_block and masks out the correct bit.

Panics

Panics if position is out of bounds.

fn get_block(&self, position: usize) -> Self::Block

Gets the block at position

The bits are laid out Block::nbits() per block, with the notional zeroth bit in the least significant position. If self.bit_len() is not a multiple of Block::nbits() then the last block will contain extra bits that are not part of the bit vector.

The default implementation assembles a block by reading each of its bits. Consider it a slow reference implementation, and override it.

Panics

Panics if position is out of bounds.

fn get_bits(&self, start: u64, count: usize) -> Self::Block

Gets count bits starting at bit index start, interpreted as a little-endian integer.

Panics

Panics if the bit span goes out of bounds.

Loading content...

Implementations on Foreign Types

impl<Block: BlockType> BitVec for [Block][src]

type Block = Block

impl<'a, Block: BlockType> BitVec for &'a [Block][src]

type Block = Block

impl<'a, Block: BlockType> BitVec for &'a mut [Block][src]

type Block = Block

impl<Block: BlockType> BitVec for Vec<Block>[src]

type Block = Block

impl BitVec for Vec<bool>[src]

type Block = u8

impl BitVec for u8[src]

type Block = u8

impl BitVec for u16[src]

type Block = u16

impl BitVec for u32[src]

type Block = u32

impl BitVec for u64[src]

type Block = u64

impl BitVec for usize[src]

type Block = usize

Loading content...

Implementors

impl<'a, Base: 'a + BitVec + ?Sized> BitVec for BitSlice<'a, Base>[src]

type Block = Base::Block

impl<'a, Base: 'a + BitVecMut + ?Sized> BitVec for BitSliceMut<'a, Base>[src]

type Block = Base::Block

impl<Block: BlockType> BitVec for BitVector<Block>[src]

type Block = Block

impl<Block: BlockType> BitVec for IntVector<Block>[src]

type Block = Block

impl<Inner: BitVec> BitVec for BitBuffer<Inner>[src]

type Block = Inner::Block

impl<Rank: BitVec> BitVec for BinSearchSelect<Rank>[src]

type Block = Rank::Block

impl<Store: BitVec> BitVec for JacobsonRank<Store>[src]

type Block = Store::Block

impl<Store: BitVec<Block = u64>> BitVec for Rank9<Store>[src]

type Block = u64

Loading content...