[][src]Struct bitstream_io::read::ByteReader

pub struct ByteReader<R: Read, E: Endianness> { /* fields omitted */ }

For reading aligned bytes from a stream of bytes in a given endianness.

This only reads aligned values and maintains no internal state.

Implementations

impl<R: Read, E: Endianness> ByteReader<R, E>[src]

pub fn new(reader: R) -> ByteReader<R, E>[src]

Wraps a ByteReader around something that implements Read

pub fn endian(reader: R, _endian: E) -> ByteReader<R, E>[src]

Wraps a ByteReader around something that implements Read with the given endianness.

pub fn into_reader(self) -> R[src]

Unwraps internal reader and disposes of ByteReader.

pub fn reader(&mut self) -> &mut R[src]

Provides mutable reference to internal reader

pub fn into_bitreader(self) -> BitReader<R, E>[src]

Converts ByteReader to BitReader in the same endianness.

pub fn bitreader(&mut self) -> BitReader<&mut R, E>[src]

Provides temporary BitReader in the same endianness.

Warning

Any unread bits left over when BitReader is dropped are lost.

Trait Implementations

impl<R: Read, E: Endianness> ByteRead for ByteReader<R, E>[src]

Auto Trait Implementations

impl<R, E> RefUnwindSafe for ByteReader<R, E> where
    E: RefUnwindSafe,
    R: RefUnwindSafe
[src]

impl<R, E> Send for ByteReader<R, E> where
    E: Send,
    R: Send
[src]

impl<R, E> Sync for ByteReader<R, E> where
    E: Sync,
    R: Sync
[src]

impl<R, E> Unpin for ByteReader<R, E> where
    E: Unpin,
    R: Unpin
[src]

impl<R, E> UnwindSafe for ByteReader<R, E> where
    E: UnwindSafe,
    R: UnwindSafe
[src]

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<T> From<T> for T[src]

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

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.