[−][src]Struct ogg::reading::PageParser
Helper struct for parsing pages
Its created using the new
function and then its fed more data via the parse_segments
and parse_packet_data
functions, each called exactly once and in that precise order.
Then later code uses the OggPage
returned by the parse_packet_data
function.
Methods
impl PageParser
[src]
pub fn new(header_buf: [u8; 27]) -> Result<(PageParser, usize), OggReadError>
[src]
Creates a new Page parser
The header_buf
param contains the first 27 bytes of a new OGG page.
Determining when one begins is your responsibility. Usually they
begin directly after the end of a previous OGG page, but
after you've performed a seek you might end up within the middle of a page
and need to recapture.
Returns a page parser, and the requested size of the segments array.
You should allocate and fill such an array, in order to pass it to the parse_segments
function.
pub fn parse_segments(&mut self, segments_buf: Vec<u8>) -> usize
[src]
Parses the segments buffer, and returns the requested size of the packets content array.
You should allocate and fill such an array, in order to pass it to the parse_packet_data
function.
pub fn parse_packet_data(
self,
packet_data: Vec<u8>
) -> Result<OggPage, OggReadError>
[src]
self,
packet_data: Vec<u8>
) -> Result<OggPage, OggReadError>
Parses the packets data and verifies the checksum.
Returns an OggPage
to be used by later code.
Auto Trait Implementations
impl Unpin for PageParser
impl Sync for PageParser
impl Send for PageParser
impl UnwindSafe for PageParser
impl RefUnwindSafe for PageParser
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,