Struct claxon::FlacReaderOptions
source · [−]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_onlyto true andread_vorbis_commentto false. The resulting reader cannot be used to read audio data. - To read only the streaminfo and tags, set
metadata_onlyandread_vorbis_commentboth to true. The resulting reader cannot be used to read audio data.
Fields
metadata_only: boolWhen 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: boolWhen 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
sourceimpl Clone for FlacReaderOptions
impl Clone for FlacReaderOptions
sourcefn clone(&self) -> FlacReaderOptions
fn clone(&self) -> FlacReaderOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for FlacReaderOptions
impl Debug for FlacReaderOptions
sourceimpl Default for FlacReaderOptions
impl Default for FlacReaderOptions
sourcefn default() -> FlacReaderOptions
fn default() -> FlacReaderOptions
Returns the “default value” for a type. Read more
sourceimpl PartialEq<FlacReaderOptions> for FlacReaderOptions
impl PartialEq<FlacReaderOptions> for FlacReaderOptions
sourcefn eq(&self, other: &FlacReaderOptions) -> bool
fn eq(&self, other: &FlacReaderOptions) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &FlacReaderOptions) -> bool
fn ne(&self, other: &FlacReaderOptions) -> bool
This method tests for !=.
impl Copy for FlacReaderOptions
impl Eq for FlacReaderOptions
impl StructuralEq for FlacReaderOptions
impl StructuralPartialEq for FlacReaderOptions
Auto Trait Implementations
impl RefUnwindSafe for FlacReaderOptions
impl Send for FlacReaderOptions
impl Sync for FlacReaderOptions
impl Unpin for FlacReaderOptions
impl UnwindSafe for FlacReaderOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more