[][src]Struct claxon::FlacReaderOptions

pub struct FlacReaderOptions {
    pub metadata_only: bool,
    pub read_vorbis_comment: bool,
}

Controls what metadata FlacReader reads when constructed.

The FLAC format contains a number of metadata blocks before the start of audio data. Reading these is wasteful if the data is never used. The FlacReaderOptions indicate which blocks to look for. As soon as all desired blocks have been read, FlacReader::new_ext() returns without reading remaining metadata blocks.

A few use cases:

  • To read only the streaminfo, as quickly as possible, set metadata_only to true and read_vorbis_comment to false. The resulting reader cannot be used to read audio data.
  • To read only the streaminfo and tags, set metadata_only and read_vorbis_comment both to true. The resulting reader cannot be used to read audio data.

Fields

metadata_only: bool

When true, return a reader as soon as all desired metadata has been read.

If this is set, the FlacReader will not be able to read audio samples. When reading audio is not desired anyway, enabling metadata_only can save a lot of expensive reads.

Defaults to false.

read_vorbis_comment: bool

When true, read metadata blocks at least until a Vorbis comment block is found.

When false, the FlacReader will be constructed without reading a Vorbis comment block, even if the stream contains one. Consequently, FlacReader::tags() and other tag-related methods will not return tag data.

Defaults to true.

Trait Implementations

impl Clone for FlacReaderOptions[src]

impl Copy for FlacReaderOptions[src]

impl Debug for FlacReaderOptions[src]

impl Default for FlacReaderOptions[src]

impl Eq for FlacReaderOptions[src]

impl PartialEq<FlacReaderOptions> for FlacReaderOptions[src]

impl StructuralEq for FlacReaderOptions[src]

impl StructuralPartialEq for FlacReaderOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.