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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.