Struct Reader

struct Reader<R, D> { ... }

Implements the Read API around an Operation.

This can be used to wrap a raw in-memory operation in a read-focused API.

It can wrap either a compression or decompression operation, and pulls input data from a wrapped Read.

Implementations

impl<R, D> Reader<R, D>

fn new(reader: R, operation: D) -> Self

Creates a new Reader.

reader will be used to pull input data for the given operation.

fn set_single_frame(self: &mut Self)

Sets self to stop after the first decoded frame.

fn operation_mut(self: &mut Self) -> &mut D

Returns a mutable reference to the underlying operation.

fn reader_mut(self: &mut Self) -> &mut R

Returns a mutable reference to the underlying reader.

fn reader(self: &Self) -> &R

Returns a reference to the underlying reader.

fn into_inner(self: Self) -> R

Returns the inner reader.

fn flush(self: &mut Self, output: &mut [u8]) -> Result<usize>
where
    D: Operation

Flush any internal buffer.

For encoders, this ensures all input consumed so far is compressed.

impl<R, D> Freeze for Reader<R, D>

impl<R, D> Read for Reader<R, D>

fn read(self: &mut Self, buf: &mut [u8]) -> Result<usize>

impl<R, D> RefUnwindSafe for Reader<R, D>

impl<R, D> Send for Reader<R, D>

impl<R, D> Sync for Reader<R, D>

impl<R, D> Unpin for Reader<R, D>

impl<R, D> UnsafeUnpin for Reader<R, D>

impl<R, D> UnwindSafe for Reader<R, D>

impl<T> Any for Reader<R, D>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Reader<R, D>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Reader<R, D>

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

impl<T> From for Reader<R, D>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Reader<R, D>

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Reader<R, D>

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

impl<T, U> TryInto for Reader<R, D>

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