pub struct FrameReader<R: ReadBytes> { /* private fields */ }
Expand description

Reads frames from a stream and exposes decoded blocks as an iterator.

TODO: for now, it is assumes that the reader starts at a frame header; no searching for a sync code is performed at the moment.

Implementations

Creates a new frame reader that will yield at least one element.

Decodes the next frame or returns an error if the data was invalid.

The buffer is moved into the returned block, so that the same buffer may be reused to decode multiple blocks, avoiding a heap allocation every time. It can be retrieved again with block.into_buffer(). If the buffer is not large enough to hold all samples, a larger buffer is allocated automatically.

TODO: I should really be consistent with ‘read’ and ‘decode’.

Destroy the frame reader, returning the wrapped reader.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.