pub struct Page {
pub end: u64,
/* private fields */
}
Expand description
An OGG page
Fields§
§end: u64
The position in the stream the page ended
Implementations§
source§impl Page
impl Page
sourcepub fn header(&self) -> &PageHeader
pub fn header(&self) -> &PageHeader
Returns a reference to the Page
’s header
sourcepub fn header_mut(&mut self) -> &mut PageHeader
pub fn header_mut(&mut self) -> &mut PageHeader
Returns a mutable reference to the Page
’s header
sourcepub fn as_bytes(&self) -> Vec<u8>
pub fn as_bytes(&self) -> Vec<u8>
Convert the Page to bytes for writing
NOTE: This will write the checksum as is. It is likely Page::gen_crc
will have
to be used prior.
sourcepub fn extend(&mut self, content: &[u8]) -> Option<Page>
pub fn extend(&mut self, content: &[u8]) -> Option<Page>
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.
sourcepub fn take_content(self) -> Vec<u8>
pub fn take_content(self) -> Vec<u8>
Consumes the page and returns its content
sourcepub fn segment_table(&self) -> Vec<u8>
pub fn segment_table(&self) -> Vec<u8>
Returns the page’s segment table
Trait Implementations§
source§impl PartialEq for Page
impl PartialEq for Page
impl Eq for Page
impl StructuralPartialEq for Page
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnwindSafe for Page
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more