[][src]Struct lrl_test_compiler::bits::BitReader

pub struct BitReader {
    data: Vec<u8>,
    cursor: usize,
    len: usize,
}

BitReader is a data structure for reading bit sized data from a sequence of bytes

Fields

data: Vec<u8>

The data in the BitReader

cursor: usize

The current position in the BitReader

len: usize

The length of content to read

Implementations

impl BitReader[src]

pub fn len(&self) -> usize[src]

pub fn remaining_len(&self) -> usize[src]

Get the number of remaining bits to be read

pub fn skip(&mut self, n: usize) -> bool[src]

Skip n bits from the BitReader

pub fn read_u8(&mut self, len: usize) -> Option<u8>[src]

Read up to one byte from the BitReader

pub fn read_u16(&mut self, len: usize) -> Option<u16>[src]

Read up to two bytes from the BitReader

pub fn read_u32(&mut self, len: usize) -> Option<u32>[src]

Read up to four bytes from the BitReader

impl BitReader[src]

pub fn from_file(path: PathBuf) -> Result<Self, Error>[src]

Creates a BitReader from a file give the file's path

Trait Implementations

impl Clone for BitReader[src]

impl Debug for BitReader[src]

impl Eq for BitReader[src]

impl<'a> From<&'a [u8]> for BitReader[src]

impl From<BitWriter> for BitReader[src]

impl From<Vec<u8>> for BitReader[src]

impl PartialEq<BitReader> for BitReader[src]

impl StructuralEq for BitReader[src]

impl StructuralPartialEq for BitReader[src]

Auto Trait Implementations

impl RefUnwindSafe for BitReader

impl Send for BitReader

impl Sync for BitReader

impl Unpin for BitReader

impl UnwindSafe for BitReader

Blanket Implementations

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

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

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

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]