Skip to main content

MetadataBlock

Enum MetadataBlock 

Source
pub enum MetadataBlock<'a> {
    VorbisComment(&'a str),
    Padding(u32),
    Application {
        id: [u8; 4],
        data: &'a [u8],
    },
    Seektable(&'a [SeekPoint]),
    CueSheet {
        media_catalog_number: &'a [u8; 128],
        lead_in: u64,
        is_cd: bool,
        tracks: &'a [CueSheetTrack<'a>],
    },
    Picture {
        picture_type: u32,
        mime_type: &'a str,
        description: &'a str,
        width: u32,
        height: u32,
        depth: u32,
        colors: u32,
        data: &'a [u8],
    },
}
Expand description

A metadata block the caller can place after STREAMINFO (which the encoder always writes first). libFLAC writes blocks in the order given (the OGG reorder is compiled out for native FLAC), so this list maps 1:1 to the output.

Variants§

§

VorbisComment(&'a str)

A VORBIS_COMMENT with the given vendor string and no user comments.

§

Padding(u32)

A PADDING block of N zero bytes.

§

Application

An APPLICATION block: a 4-byte registered application id + opaque data.

Fields

§id: [u8; 4]
§data: &'a [u8]
§

Seektable(&'a [SeekPoint])

A SEEKTABLE block: the seek points to serialize, in order. The encoder fills a template (each point’s sample_number a target, offsets 0) during encoding and writes the filled+sorted result; write_seektable serializes whatever points it is given verbatim.

§

CueSheet

A CUESHEET block: the 128-byte media catalog number, lead-in samples, the CD-DA flag, and the track list (each with its index points). Fully caller-supplied — unlike SEEKTABLE, nothing is generated during encoding.

Fields

§media_catalog_number: &'a [u8; 128]
§lead_in: u64
§is_cd: bool
§tracks: &'a [CueSheetTrack<'a>]
§

Picture

A PICTURE block (e.g. cover art). mime_type/description are stored with 32-bit length prefixes; picture_type is the FLAC picture-type code.

Fields

§picture_type: u32
§mime_type: &'a str
§description: &'a str
§width: u32
§height: u32
§depth: u32
§colors: u32
§data: &'a [u8]

Auto Trait Implementations§

§

impl<'a> Freeze for MetadataBlock<'a>

§

impl<'a> RefUnwindSafe for MetadataBlock<'a>

§

impl<'a> Send for MetadataBlock<'a>

§

impl<'a> Sync for MetadataBlock<'a>

§

impl<'a> Unpin for MetadataBlock<'a>

§

impl<'a> UnsafeUnpin for MetadataBlock<'a>

§

impl<'a> UnwindSafe for MetadataBlock<'a>

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.