[][src]Struct succinct::stream::BitBuffer

pub struct BitBuffer<Inner = BitVector> { /* fields omitted */ }

A bit buffer can be used to read bits from or write bits to an underlying bit vector.

Methods

impl<Block: BlockType> BitBuffer<BitVector<Block>>[src]

pub fn new() -> Self[src]

Creates a new, empty bit buffer.

pub fn with_capacity(capacity: u64) -> Self[src]

Creates a new, empty bit buffer with the given capacity (in bits) preallocated.

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

pub fn from(input: Inner) -> Self[src]

Creates a new bit buffer for reading from a bit vector.

pub fn append(vec: Inner) -> Self[src]

Creates a new bit buffer for appending to a bit vector.

pub fn seek(&mut self, position: u64) -> Result<()>[src]

Moves the position for the next read or write.

impl<Inner> BitBuffer<Inner>[src]

pub fn into_inner(self) -> Inner[src]

Returns the bit vector underlying the bit buffer.

pub fn inner(&self) -> &Inner[src]

Gives access to the bit vector underlying the bit buffer.

pub fn position(&self) -> u64[src]

The position in the bit buffer where the next read or write will occur.

Trait Implementations

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

fn read_int<N: PrimInt>(&mut self, nbits: usize) -> Result<Option<N>>[src]

Reads nbits bits as an integer, least-significant bit first.

fn read_int_be<N: PrimInt>(&mut self, nbits: usize) -> Result<Option<N>>[src]

Reads nbits bits as an integer, most-significant bit first.

impl<Inner: BitVecPush> BitWrite for BitBuffer<Inner>[src]

fn write_int<N: PrimInt>(&mut self, nbits: usize, value: N) -> Result<()>[src]

Writes the lower nbits of value, least-significant first.

fn write_int_be<N: PrimInt>(&mut self, nbits: usize, value: N) -> Result<()>[src]

Writes the lower nbits of value, most-significant first.

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

type Block = Inner::Block

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

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

Gets the bit at position Read more

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

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

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

fn set_bit(&mut self, position: u64, value: bool)[src]

Sets the bit at position to value. Read more

fn set_bits(&mut self, start: u64, count: usize, value: Self::Block)[src]

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

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

impl<Inner> Send for BitBuffer<Inner> where
    Inner: Send

impl<Inner> Unpin for BitBuffer<Inner> where
    Inner: Unpin

impl<Inner> Sync for BitBuffer<Inner> where
    Inner: Sync

impl<Inner> UnwindSafe for BitBuffer<Inner> where
    Inner: UnwindSafe

impl<Inner> RefUnwindSafe for BitBuffer<Inner> where
    Inner: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]