Metadata

Struct Metadata 

Source
pub struct Metadata {
    pub data: Data,
    /* private fields */
}
Expand description

Data associated with a single metadata block.

Fields§

§data: Data

Block data containing one of the eight different types of metadata.

Implementations§

Source§

impl Metadata

Source

pub fn new(is_last: bool, length: u32, data: Data) -> Self

Constructs a new Metadata struct based on the arguments passed in.

Source

pub fn is_last(&self) -> bool

Returns whether the current metadata block is the last.

Source

pub fn data_type(&self) -> Type

Returns the metadata block’s type.

Source

pub fn is_stream_info(&self) -> bool

Returns true when the current Metadata is StreamInfo.

Source

pub fn is_padding(&self) -> bool

Returns true when the current Metadata is Padding.

Source

pub fn is_application(&self) -> bool

Returns true when the current Metadata is Application.

Source

pub fn is_seek_table(&self) -> bool

Returns true when the current Metadata is SeekTable.

Source

pub fn is_vorbis_comment(&self) -> bool

Returns true when the current Metadata is VorbisComment.

Source

pub fn is_cue_sheet(&self) -> bool

Returns true when the current Metadata is CueSheet.

Source

pub fn is_picture(&self) -> bool

Returns true when the current Metadata is Picture.

Source

pub fn is_unknown(&self) -> bool

Returns true when the current Metadata is Unknown.

Source

pub fn bytes_len(&self) -> usize

Source

pub fn to_bytes<Write: Write>(&self, buffer: &mut Write) -> Result<()>

Trait Implementations§

Source§

impl Debug for Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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>,

Source§

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>,

Source§

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.