Struct ogg_pager::Page [−][src]
pub struct Page {
pub abgp: u64,
pub serial: u32,
pub seq_num: u32,
pub start: u64,
pub end: u64,
// some fields omitted
}
Expand description
An OGG page
Fields
abgp: u64
The page’s absolute granule position
serial: u32
The page’s stream serial number
seq_num: u32
The page’s sequence number
start: u64
The position in the stream the page started at
end: u64
The position in the stream the page ended
Implementations
Create a new Page
This will have the following defaults:
checksum
= 0start
= 0end
=content.len()
Errors
See segment_table
Example
use ogg_pager::CONTAINS_FIRST_PAGE_OF_BITSTREAM;
// Creating the identification header
let ident_header_packet = vec![...];
let stream_serial_number = 2784419176;
let page = Page::new(
CONTAINS_FIRST_PAGE_OF_BITSTREAM,
0,
stream_serial_number,
ident_header_packet,
);
Convert the Page to Vec
NOTE: This will write the checksum as is. It is likely Page::gen_crc will have to be used prior.
Attempts to get a Page from a reader
Use skip_content
to only read the header, and skip over the content.
Errors
Extends the Page’s content, returning another Page if too much data was provided
This will do nothing if content
is greater than the max page size. In this case,
paginate
should be used.
Returns the page’s content
Consumes the page and returns it’s content
Returns the page’s header type flag
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Page
impl UnwindSafe for Page
Blanket Implementations
Mutably borrows from an owned value. Read more