[−][src]Struct succinct::stream::BitBuffer
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_bit(&mut self) -> Result<Option<bool>>
[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_bit(&mut self, value: bool) -> Result<()>
[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 block_len(&self) -> usize
[src]
fn bit_len(&self) -> u64
[src]
fn get_block(&self, position: usize) -> Self::Block
[src]
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_block(&mut self, position: usize, value: Self::Block)
[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(&self) -> 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,
Inner: Send,
impl<Inner> Unpin for BitBuffer<Inner> where
Inner: Unpin,
Inner: Unpin,
impl<Inner> Sync for BitBuffer<Inner> where
Inner: Sync,
Inner: Sync,
impl<Inner> RefUnwindSafe for BitBuffer<Inner> where
Inner: RefUnwindSafe,
Inner: RefUnwindSafe,
impl<Inner> UnwindSafe for BitBuffer<Inner> where
Inner: UnwindSafe,
Inner: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,