pub enum Quality {
Variable(u32),
Bitrate(u32),
}Expand description
How hard the encoder should try, as the user asked for it.
Variants§
Variable(u32)
A variable-quality setting, V0–V9 for MP3 or q0–q10 for Vorbis:
lower is better for MP3, higher is better for Vorbis, which is the
encoders’ own convention and not something to paper over.
Bitrate(u32)
A constant bitrate in kbps, written 192k.
Implementations§
Source§impl Quality
impl Quality
Sourcepub const FORMS: &'static str = "V0…V9 for MP3, q0…q10 for Vorbis, or a bitrate like 192k"
pub const FORMS: &'static str = "V0…V9 for MP3, q0…q10 for Vorbis, or a bitrate like 192k"
How the setting is written, for a message that repeats what was typed.
Sourcepub fn parse(word: &str) -> Option<Quality>
pub fn parse(word: &str) -> Option<Quality>
Reads V0, q6 or 192k, and nothing else.
A value that parses as none of the three is refused rather than quietly replaced by the default: an encoder silently running at the wrong setting produces files that are wrong in a way nobody notices until the card is full.
Trait Implementations§
impl Copy for Quality
impl Eq for Quality
impl StructuralPartialEq for Quality
Auto Trait Implementations§
impl Freeze for Quality
impl RefUnwindSafe for Quality
impl Send for Quality
impl Sync for Quality
impl Unpin for Quality
impl UnwindSafe for Quality
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more