Struct ogg::Packet

source ·
pub struct Packet {
    pub data: Vec<u8>,
    /* private fields */
}
Expand description

Ogg packet representation.

For the Ogg format, packets are the logically smallest subdivision it handles.

Every packet belongs to a logical bitstream. The logical bitstreams then form a physical bitstream, with the data combined in multiple different ways.

Every logical bitstream is identified by the serial number its pages have stored. The Packet struct contains a field for that number as well, so that one can find out which logical bitstream the Packet belongs to.

Fields§

§data: Vec<u8>

The data the Packet contains

Implementations§

source§

impl Packet

source

pub fn first_in_page(&self) -> bool

Returns whether the packet is the first one starting in the page

source

pub fn first_in_stream(&self) -> bool

Returns whether the packet is the first one of the entire stream

source

pub fn last_in_page(&self) -> bool

Returns whether the packet is the last one starting in the page

source

pub fn last_in_stream(&self) -> bool

Returns whether the packet is the last one of the entire stream

source

pub fn absgp_page(&self) -> u64

Returns the absolute granule position of the page the packet ended in.

The meaning of the absolute granule position is defined by the codec.

source

pub fn stream_serial(&self) -> u32

Returns the serial number that uniquely identifies the logical bitstream.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.