#[non_exhaustive]pub enum ContainerFormat {
Show 15 variants
Mp3,
Aac,
Flac,
Ogg,
Opus,
Wav,
Aiff,
Alac,
Wma,
Ape,
Wv,
Mka,
M4a,
Caf,
Other(SmolStr),
}alloc or std only.Expand description
Audio-only file / container format vocabulary.
Top-level multimedia containers (mp4/mkv/mov/webm/…)
live on crate::container::Format; this enum
enumerates the audio-only containers (one audio stream, no
video). Closed-ish vocabulary — not FFmpeg-coded, so there is no
to_u32/from_u32; the Other(SmolStr) arm preserves unknown
slugs losslessly.
as_str returns the file-extension-style slug ("mp3", "aac",
"flac", …).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Mp3
MPEG-1/2 Audio Layer III (.mp3). The auto-derived predicate
name would be is_mp_3 (digit-snake-case); the hand-written
Self::is_mp3 uses the cleaner name.
Aac
Raw AAC ADTS / ADIF stream (.aac).
Flac
Free Lossless Audio Codec (.flac).
Ogg
Ogg Vorbis / generic Ogg container (.ogg).
Opus
Opus in Ogg or raw (.opus).
Wav
RIFF WAVE (.wav).
Aiff
Audio Interchange File Format (.aiff / .aif).
Alac
Apple Lossless (ALAC) — usually carried inside .m4a,
occasionally .caf; this variant is the bare-codec spelling.
Wma
Windows Media Audio (.wma).
Ape
Monkey’s Audio (.ape).
Wv
WavPack (.wv).
Mka
Matroska Audio (.mka).
M4a
MPEG-4 audio-only (.m4a) — AAC / ALAC in an MP4 box layout.
The auto-derived predicate name would be is_m_4_a
(digit-snake-case); the hand-written Self::is_m4a uses the
cleaner name.
Caf
Apple Core Audio Format (.caf).
Other(SmolStr)
A container not enumerated above — carries the extension-style slug verbatim. Lossless escape.
Implementations§
Source§impl ContainerFormat
impl ContainerFormat
Sourcepub const fn is_aac(&self) -> bool
pub const fn is_aac(&self) -> bool
Returns true if this value is of type Aac. Returns false otherwise
Sourcepub const fn is_flac(&self) -> bool
pub const fn is_flac(&self) -> bool
Returns true if this value is of type Flac. Returns false otherwise
Sourcepub const fn is_ogg(&self) -> bool
pub const fn is_ogg(&self) -> bool
Returns true if this value is of type Ogg. Returns false otherwise
Sourcepub const fn is_opus(&self) -> bool
pub const fn is_opus(&self) -> bool
Returns true if this value is of type Opus. Returns false otherwise
Sourcepub const fn is_wav(&self) -> bool
pub const fn is_wav(&self) -> bool
Returns true if this value is of type Wav. Returns false otherwise
Sourcepub const fn is_aiff(&self) -> bool
pub const fn is_aiff(&self) -> bool
Returns true if this value is of type Aiff. Returns false otherwise
Sourcepub const fn is_alac(&self) -> bool
pub const fn is_alac(&self) -> bool
Returns true if this value is of type Alac. Returns false otherwise
Sourcepub const fn is_wma(&self) -> bool
pub const fn is_wma(&self) -> bool
Returns true if this value is of type Wma. Returns false otherwise
Sourcepub const fn is_ape(&self) -> bool
pub const fn is_ape(&self) -> bool
Returns true if this value is of type Ape. Returns false otherwise
Sourcepub const fn is_wv(&self) -> bool
pub const fn is_wv(&self) -> bool
Returns true if this value is of type Wv. Returns false otherwise
Sourcepub const fn is_mka(&self) -> bool
pub const fn is_mka(&self) -> bool
Returns true if this value is of type Mka. Returns false otherwise
Source§impl ContainerFormat
impl ContainerFormat
Sourcepub fn unwrap_mp_3(self)
pub fn unwrap_mp_3(self)
Unwraps this value to the ContainerFormat::Mp3 variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_mp_3_ref(&self)
pub fn unwrap_mp_3_ref(&self)
Unwraps this reference to the ContainerFormat::Mp3 variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_mp_3_mut(&mut self)
pub fn unwrap_mp_3_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Mp3 variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aac(self)
pub fn unwrap_aac(self)
Unwraps this value to the ContainerFormat::Aac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aac_ref(&self)
pub fn unwrap_aac_ref(&self)
Unwraps this reference to the ContainerFormat::Aac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aac_mut(&mut self)
pub fn unwrap_aac_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Aac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_flac(self)
pub fn unwrap_flac(self)
Unwraps this value to the ContainerFormat::Flac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_flac_ref(&self)
pub fn unwrap_flac_ref(&self)
Unwraps this reference to the ContainerFormat::Flac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_flac_mut(&mut self)
pub fn unwrap_flac_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Flac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ogg(self)
pub fn unwrap_ogg(self)
Unwraps this value to the ContainerFormat::Ogg variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ogg_ref(&self)
pub fn unwrap_ogg_ref(&self)
Unwraps this reference to the ContainerFormat::Ogg variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ogg_mut(&mut self)
pub fn unwrap_ogg_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Ogg variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_opus(self)
pub fn unwrap_opus(self)
Unwraps this value to the ContainerFormat::Opus variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_opus_ref(&self)
pub fn unwrap_opus_ref(&self)
Unwraps this reference to the ContainerFormat::Opus variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_opus_mut(&mut self)
pub fn unwrap_opus_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Opus variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wav(self)
pub fn unwrap_wav(self)
Unwraps this value to the ContainerFormat::Wav variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wav_ref(&self)
pub fn unwrap_wav_ref(&self)
Unwraps this reference to the ContainerFormat::Wav variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wav_mut(&mut self)
pub fn unwrap_wav_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Wav variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aiff(self)
pub fn unwrap_aiff(self)
Unwraps this value to the ContainerFormat::Aiff variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aiff_ref(&self)
pub fn unwrap_aiff_ref(&self)
Unwraps this reference to the ContainerFormat::Aiff variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aiff_mut(&mut self)
pub fn unwrap_aiff_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Aiff variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_alac(self)
pub fn unwrap_alac(self)
Unwraps this value to the ContainerFormat::Alac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_alac_ref(&self)
pub fn unwrap_alac_ref(&self)
Unwraps this reference to the ContainerFormat::Alac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_alac_mut(&mut self)
pub fn unwrap_alac_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Alac variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wma(self)
pub fn unwrap_wma(self)
Unwraps this value to the ContainerFormat::Wma variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wma_ref(&self)
pub fn unwrap_wma_ref(&self)
Unwraps this reference to the ContainerFormat::Wma variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wma_mut(&mut self)
pub fn unwrap_wma_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Wma variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ape(self)
pub fn unwrap_ape(self)
Unwraps this value to the ContainerFormat::Ape variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ape_ref(&self)
pub fn unwrap_ape_ref(&self)
Unwraps this reference to the ContainerFormat::Ape variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ape_mut(&mut self)
pub fn unwrap_ape_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Ape variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wv(self)
pub fn unwrap_wv(self)
Unwraps this value to the ContainerFormat::Wv variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wv_ref(&self)
pub fn unwrap_wv_ref(&self)
Unwraps this reference to the ContainerFormat::Wv variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_wv_mut(&mut self)
pub fn unwrap_wv_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Wv variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_mka(self)
pub fn unwrap_mka(self)
Unwraps this value to the ContainerFormat::Mka variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_mka_ref(&self)
pub fn unwrap_mka_ref(&self)
Unwraps this reference to the ContainerFormat::Mka variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_mka_mut(&mut self)
pub fn unwrap_mka_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Mka variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_m_4_a(self)
pub fn unwrap_m_4_a(self)
Unwraps this value to the ContainerFormat::M4a variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_m_4_a_ref(&self)
pub fn unwrap_m_4_a_ref(&self)
Unwraps this reference to the ContainerFormat::M4a variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_m_4_a_mut(&mut self)
pub fn unwrap_m_4_a_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::M4a variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_caf(self)
pub fn unwrap_caf(self)
Unwraps this value to the ContainerFormat::Caf variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_caf_ref(&self)
pub fn unwrap_caf_ref(&self)
Unwraps this reference to the ContainerFormat::Caf variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_caf_mut(&mut self)
pub fn unwrap_caf_mut(&mut self)
Unwraps this mutable reference to the ContainerFormat::Caf variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_other(self) -> SmolStr
pub fn unwrap_other(self) -> SmolStr
Unwraps this value to the ContainerFormat::Other variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_other_ref(&self) -> &SmolStr
pub fn unwrap_other_ref(&self) -> &SmolStr
Unwraps this reference to the ContainerFormat::Other variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_other_mut(&mut self) -> &mut SmolStr
pub fn unwrap_other_mut(&mut self) -> &mut SmolStr
Unwraps this mutable reference to the ContainerFormat::Other variant.
Panics if this value is of any other type.
Source§impl ContainerFormat
impl ContainerFormat
Sourcepub fn try_unwrap_mp_3(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_mp_3(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Mp3 variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_mp_3_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_mp_3_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Mp3 variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_mp_3_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_mp_3_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Mp3 variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aac(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_aac(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Aac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aac_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_aac_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Aac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aac_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_aac_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Aac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_flac(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_flac(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Flac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_flac_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_flac_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Flac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_flac_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_flac_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Flac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ogg(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_ogg(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Ogg variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ogg_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_ogg_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Ogg variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ogg_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_ogg_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Ogg variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_opus(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_opus(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Opus variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_opus_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_opus_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Opus variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_opus_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_opus_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Opus variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wav(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_wav(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Wav variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wav_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_wav_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Wav variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wav_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_wav_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Wav variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aiff(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_aiff(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Aiff variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aiff_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_aiff_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Aiff variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aiff_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_aiff_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Aiff variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_alac(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_alac(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Alac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_alac_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_alac_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Alac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_alac_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_alac_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Alac variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wma(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_wma(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Wma variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wma_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_wma_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Wma variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wma_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_wma_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Wma variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ape(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_ape(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Ape variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ape_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_ape_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Ape variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ape_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_ape_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Ape variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wv(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_wv(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Wv variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wv_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_wv_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Wv variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_wv_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_wv_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Wv variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_mka(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_mka(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Mka variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_mka_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_mka_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Mka variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_mka_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_mka_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Mka variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_m_4_a(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_m_4_a(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::M4a variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_m_4_a_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_m_4_a_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::M4a variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_m_4_a_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_m_4_a_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::M4a variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_caf(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_caf(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Caf variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_caf_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_caf_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Caf variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_caf_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_caf_mut(&mut self) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Caf variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_other(self) -> Result<SmolStr, TryUnwrapError<Self>>
pub fn try_unwrap_other(self) -> Result<SmolStr, TryUnwrapError<Self>>
Attempts to unwrap this value to the ContainerFormat::Other variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_other_ref(&self) -> Result<&SmolStr, TryUnwrapError<&Self>>
pub fn try_unwrap_other_ref(&self) -> Result<&SmolStr, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ContainerFormat::Other variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_other_mut(
&mut self,
) -> Result<&mut SmolStr, TryUnwrapError<&mut Self>>
pub fn try_unwrap_other_mut( &mut self, ) -> Result<&mut SmolStr, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ContainerFormat::Other variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Source§impl ContainerFormat
impl ContainerFormat
Sourcepub const fn is_mp3(&self) -> bool
pub const fn is_mp3(&self) -> bool
True iff this is Self::Mp3. Hand-written to override the
auto-derived is_mp_3 (digit-snake-case is ugly).
Sourcepub const fn is_m4a(&self) -> bool
pub const fn is_m4a(&self) -> bool
True iff this is Self::M4a. Hand-written to override the
auto-derived is_m_4_a (digit-snake-case is ugly).
Sourcepub const fn as_extension(&self) -> &'static str
pub const fn as_extension(&self) -> &'static str
Primary file-on-disk extension (without the leading dot —
"mp3", "flac", "m4a", …). For most audio containers the
extension matches the FFmpeg slug from Self::as_str; the
exception is Alac, which has no standalone extension (the
codec rides inside .m4a), so this method returns "m4a".
Returns "" for Self::Other — the open variant carries an
FFmpeg slug, not an extension, so the mapping is unknown.
Returns &'static str (not &str) so the value is compile-time
stable and the method is const.
Sourcepub fn other(slug: impl AsRef<str>) -> Self
pub fn other(slug: impl AsRef<str>) -> Self
The open escape for a slug this vocabulary does not name, ASCII-folded to the crate’s lowercase canon.
The one construction path for Self::Other: folding here is what
keeps the whole value space lowercase-canonical, so the derived Eq /
Hash compare names rather than spellings. Constructing the variant
directly bypasses the fold and is not the supported spelling.
Source§impl ContainerFormat
impl ContainerFormat
Sourcepub const ROSTER: &'static [Self]
pub const ROSTER: &'static [Self]
Every audio container format this vocabulary names, in declaration order.
A slice rather than an array: how many names this build carries is a fact about the release, not part of the type, so a later addition stays a minor change.
The open escape arm is not a member. The roster answers “which names does this build know”, and the escape is precisely the arm that carries a name it does not — listing it would need a slug to put in it, and there isn’t one.
Trait Implementations§
Source§impl Arbitrary for ContainerFormat
impl Arbitrary for ContainerFormat
Source§impl<'a> Arbitrary<'a> for ContainerFormat
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for ContainerFormat
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for ContainerFormat
impl Clone for ContainerFormat
Source§fn clone(&self) -> ContainerFormat
fn clone(&self) -> ContainerFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerFormat
impl Debug for ContainerFormat
Source§impl Default for ContainerFormat
impl Default for ContainerFormat
Source§impl DefaultInstance for ContainerFormat
Available on crate feature buffa only.
impl DefaultInstance for ContainerFormat
buffa only.Source§fn default_instance() -> &'static Self
fn default_instance() -> &'static Self
Source§impl<'de> Deserialize<'de> for ContainerFormat
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ContainerFormat
serde only.Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Source§impl Display for ContainerFormat
impl Display for ContainerFormat
impl Eq for ContainerFormat
Source§impl FromStr for ContainerFormat
impl FromStr for ContainerFormat
Source§impl Hash for ContainerFormat
impl Hash for ContainerFormat
Source§impl Message for ContainerFormat
Available on crate feature buffa only.
impl Message for ContainerFormat
buffa only.Source§fn compute_size(&self, _cache: &mut SizeCache) -> u32
fn compute_size(&self, _cache: &mut SizeCache) -> u32
cache for write_to to consume. Read moreSource§fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl EncodeSink)
fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl EncodeSink)
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn merge_field(
&mut self,
tag: Tag,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
buf. Read moreSource§fn encode(&self, buf: &mut impl EncodeSink)
fn encode(&self, buf: &mut impl EncodeSink)
Source§fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>
fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>
MAX_MESSAGE_BYTES). Read moreSource§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)
Source§fn try_encode_with_cache(
&self,
cache: &mut SizeCache,
buf: &mut impl EncodeSink,
) -> Result<(), EncodeError>
fn try_encode_with_cache( &self, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>
SizeCache,
returning an error instead of panicking if the encoded size exceeds
the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Clears the cache
first. Read moreSource§fn try_encode_bounded(
&self,
max_bytes: u32,
buf: &mut impl EncodeSink,
) -> Result<u32, EncodeError>
fn try_encode_bounded( &self, max_bytes: u32, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>
buf only if its encoded size fits within
max_bytes, using a single size pass that is then reused for the write. Read moreSource§fn try_encode_bounded_with_cache(
&self,
max_bytes: u32,
cache: &mut SizeCache,
buf: &mut impl EncodeSink,
) -> Result<u32, EncodeError>
fn try_encode_bounded_with_cache( &self, max_bytes: u32, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>
Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Source§fn try_encoded_len(&self) -> Result<u32, EncodeError>
fn try_encoded_len(&self) -> Result<u32, EncodeError>
MAX_MESSAGE_BYTES). Read moreSource§fn encode_length_delimited(&self, buf: &mut impl EncodeSink)
fn encode_length_delimited(&self, buf: &mut impl EncodeSink)
Source§fn try_encode_length_delimited(
&self,
buf: &mut impl EncodeSink,
) -> Result<(), EncodeError>
fn try_encode_length_delimited( &self, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>
MAX_MESSAGE_BYTES). Read moreSource§fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
Vec<u8>, returning an error instead of panicking
if the encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES). Read moreSource§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
bytes::Bytes. Read moreSource§fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>
fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>
bytes::Bytes, returning an error instead of
panicking if the encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES). Read moreSource§fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn merge_to_limit(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
limit: usize,
) -> Result<(), DecodeError>
fn merge_to_limit( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, limit: usize, ) -> Result<(), DecodeError>
Source§fn merge_group(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
field_number: u32,
) -> Result<(), DecodeError>
fn merge_group( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, field_number: u32, ) -> Result<(), DecodeError>
buf, reading fields until an
EndGroup tag with the given field_number is encountered. Read moreSource§fn merge(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Source§fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
Source§fn merge_length_delimited(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_length_delimited( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Source§impl PartialEq for ContainerFormat
impl PartialEq for ContainerFormat
Source§impl Serialize for ContainerFormat
Available on crate feature serde only.
impl Serialize for ContainerFormat
serde only.