Skip to main content

ByteReader

Struct ByteReader 

Source
pub struct ByteReader<R> { /* private fields */ }

Implementations§

Source§

impl<E, R: Iterator<Item = Result<u8, E>>> ByteReader<R>

Source

pub fn new(read: R) -> Result<Self, E>

Construct a new ByteReader from an iterator of u8

Source

pub fn print_remaining(&mut self)

Print the remaining data

Note: For debug purposes only, not part of the API.

Source

pub fn print_peek(&self)

Trait Implementations§

Source§

impl<E, R: Iterator<Item = Result<u8, E>>> BitReader for ByteReader<R>

Source§

type Error = E

Source§

fn peek(&self, bits: u8) -> Option<u16>

look at the next (up to 16) bits of data Read more
Source§

fn consume(&mut self, bits: u8) -> Result<(), E>

Consume the given amount of bits from the input.
Source§

fn bits_to_byte_boundary(&self) -> u8

Source§

fn expect(&mut self, bits: Bits) -> Result<(), Option<Bits>>

Assert that the next bits matches the given pattern. Read more

Auto Trait Implementations§

§

impl<R> Freeze for ByteReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for ByteReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for ByteReader<R>
where R: Send,

§

impl<R> Sync for ByteReader<R>
where R: Sync,

§

impl<R> Unpin for ByteReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for ByteReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for ByteReader<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.