Struct ogg::PacketReader [] [src]

pub struct PacketReader<T: Read + Seek> { /* fields omitted */ }

Reader for packets from an Ogg stream.

This reads codec packets belonging to several different logical streams from one physical Ogg container stream.

If the async feature is activated, and you pass as internal reader a valid implementation of the AdvanceAndSeekBack trait, like the BufReader wrapper, the PacketReader will support async operation, meaning that its internal state doesn't get corrupted if from multiple consecutive reads which it performs, some fail with e.g. the WouldBlock error kind.

Methods

impl<T: Read + Seek> PacketReader<T>
[src]

Constructs a new PacketReader with a given Read.

Reads a packet, and returns it on success.

Seeks the underlying reader

Seeks the reader that this PacketReader bases on by the specified number of bytes. All new pages will be read from the new position.

This also flushes all the unread packets in the queue.