Skip to main content

ContainerFormat

Enum ContainerFormat 

Source
#[non_exhaustive]
pub enum ContainerFormat {
Show 15 variants Mp3, Aac, Flac, Ogg, Opus, Wav, Aiff, Alac, Wma, Ape, Wv, Mka, M4a, Caf, Other(SmolStr),
}
Available on crate features 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

pub const fn is_aac(&self) -> bool

Returns true if this value is of type Aac. Returns false otherwise

Source

pub const fn is_flac(&self) -> bool

Returns true if this value is of type Flac. Returns false otherwise

Source

pub const fn is_ogg(&self) -> bool

Returns true if this value is of type Ogg. Returns false otherwise

Source

pub const fn is_opus(&self) -> bool

Returns true if this value is of type Opus. Returns false otherwise

Source

pub const fn is_wav(&self) -> bool

Returns true if this value is of type Wav. Returns false otherwise

Source

pub const fn is_aiff(&self) -> bool

Returns true if this value is of type Aiff. Returns false otherwise

Source

pub const fn is_alac(&self) -> bool

Returns true if this value is of type Alac. Returns false otherwise

Source

pub const fn is_wma(&self) -> bool

Returns true if this value is of type Wma. Returns false otherwise

Source

pub const fn is_ape(&self) -> bool

Returns true if this value is of type Ape. Returns false otherwise

Source

pub const fn is_wv(&self) -> bool

Returns true if this value is of type Wv. Returns false otherwise

Source

pub const fn is_mka(&self) -> bool

Returns true if this value is of type Mka. Returns false otherwise

Source

pub const fn is_caf(&self) -> bool

Returns true if this value is of type Caf. Returns false otherwise

Source

pub const fn is_other(&self) -> bool

Returns true if this value is of type Other. Returns false otherwise

Source§

impl ContainerFormat

Source

pub fn unwrap_mp_3(self)

Unwraps this value to the ContainerFormat::Mp3 variant. Panics if this value is of any other type.

Source

pub fn unwrap_mp_3_ref(&self)

Unwraps this reference to the ContainerFormat::Mp3 variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_aac(self)

Unwraps this value to the ContainerFormat::Aac variant. Panics if this value is of any other type.

Source

pub fn unwrap_aac_ref(&self)

Unwraps this reference to the ContainerFormat::Aac variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_flac(self)

Unwraps this value to the ContainerFormat::Flac variant. Panics if this value is of any other type.

Source

pub fn unwrap_flac_ref(&self)

Unwraps this reference to the ContainerFormat::Flac variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_ogg(self)

Unwraps this value to the ContainerFormat::Ogg variant. Panics if this value is of any other type.

Source

pub fn unwrap_ogg_ref(&self)

Unwraps this reference to the ContainerFormat::Ogg variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_opus(self)

Unwraps this value to the ContainerFormat::Opus variant. Panics if this value is of any other type.

Source

pub fn unwrap_opus_ref(&self)

Unwraps this reference to the ContainerFormat::Opus variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_wav(self)

Unwraps this value to the ContainerFormat::Wav variant. Panics if this value is of any other type.

Source

pub fn unwrap_wav_ref(&self)

Unwraps this reference to the ContainerFormat::Wav variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_aiff(self)

Unwraps this value to the ContainerFormat::Aiff variant. Panics if this value is of any other type.

Source

pub fn unwrap_aiff_ref(&self)

Unwraps this reference to the ContainerFormat::Aiff variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_alac(self)

Unwraps this value to the ContainerFormat::Alac variant. Panics if this value is of any other type.

Source

pub fn unwrap_alac_ref(&self)

Unwraps this reference to the ContainerFormat::Alac variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_wma(self)

Unwraps this value to the ContainerFormat::Wma variant. Panics if this value is of any other type.

Source

pub fn unwrap_wma_ref(&self)

Unwraps this reference to the ContainerFormat::Wma variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_ape(self)

Unwraps this value to the ContainerFormat::Ape variant. Panics if this value is of any other type.

Source

pub fn unwrap_ape_ref(&self)

Unwraps this reference to the ContainerFormat::Ape variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_wv(self)

Unwraps this value to the ContainerFormat::Wv variant. Panics if this value is of any other type.

Source

pub fn unwrap_wv_ref(&self)

Unwraps this reference to the ContainerFormat::Wv variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_mka(self)

Unwraps this value to the ContainerFormat::Mka variant. Panics if this value is of any other type.

Source

pub fn unwrap_mka_ref(&self)

Unwraps this reference to the ContainerFormat::Mka variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_m_4_a(self)

Unwraps this value to the ContainerFormat::M4a variant. Panics if this value is of any other type.

Source

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.

Source

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.

Source

pub fn unwrap_caf(self)

Unwraps this value to the ContainerFormat::Caf variant. Panics if this value is of any other type.

Source

pub fn unwrap_caf_ref(&self)

Unwraps this reference to the ContainerFormat::Caf variant. Panics if this value is of any other type.

Source

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.

Source

pub fn unwrap_other(self) -> SmolStr

Unwraps this value to the ContainerFormat::Other variant. Panics if this value is of any other type.

Source

pub fn unwrap_other_ref(&self) -> &SmolStr

Unwraps this reference to the ContainerFormat::Other variant. Panics if this value is of any other type.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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).

Source

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).

Source

pub fn as_str(&self) -> &str

File-extension-style slug ("mp3", "aac", "flac", …).

Source

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.

Source

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

Source

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

Source§

fn arbitrary(__quickcheck_g: &mut Gen) -> Self

Return an arbitrary value. Read more
Source§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>>

Return an iterator of values that are smaller than itself. Read more
Source§

impl<'a> Arbitrary<'a> for ContainerFormat

Available on crate feature arbitrary only.
Source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl Clone for ContainerFormat

Source§

fn clone(&self) -> ContainerFormat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ContainerFormat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ContainerFormat

Source§

fn default() -> Self

Other("") — the wire-zero / “absent” sentinel. Audio containers vary by source; there is no universally-defensible default. Callers picking a meaningful fallback should be explicit.

Source§

impl DefaultInstance for ContainerFormat

Available on crate feature buffa only.
Source§

fn default_instance() -> &'static Self

Return a reference to the single default instance of this type.
Source§

impl<'de> Deserialize<'de> for ContainerFormat

Available on crate feature serde only.
Source§

fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ContainerFormat

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ContainerFormat

Source§

impl FromStr for ContainerFormat

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Recognise a canonical extension-style slug; unknown values land in Self::Other (infallible, lossless).

Source§

type Err = Infallible

The associated error which can be returned from parsing.
Source§

impl Hash for ContainerFormat

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for ContainerFormat

Available on crate feature buffa only.
Source§

fn compute_size(&self, _cache: &mut SizeCache) -> u32

Compute the encoded byte size of this message, recording nested sub-message sizes in cache for write_to to consume. Read more
Source§

fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl EncodeSink)

Write this message’s encoded bytes to a buffer, consuming nested-message sizes from cache (populated by a prior compute_size call on the same cache). Read more
Source§

fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>

Processes a single already-decoded tag and its associated field data from buf. Read more
Source§

fn clear(&mut self)

Clear all fields to their default values.
Source§

fn encode(&self, buf: &mut impl EncodeSink)

Compute size, then write. This is the primary encoding API. Read more
Source§

fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>

Encode, returning an error instead of panicking if the encoded size exceeds the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Read more
Source§

fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)

Encode using a caller-supplied SizeCache, for reuse across many encodes in a hot loop. Clears the cache first. Read more
Source§

fn try_encode_with_cache( &self, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>

Encode with a caller-supplied 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 more
Source§

fn try_encode_bounded( &self, max_bytes: u32, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>

Encode this message into buf only if its encoded size fits within max_bytes, using a single size pass that is then reused for the write. Read more
Source§

fn try_encode_bounded_with_cache( &self, max_bytes: u32, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>

Like try_encode_bounded but reuses an existing SizeCache, clearing it first. Read more
Source§

fn encoded_len(&self) -> u32

Compute the encoded byte size of this message. Read more
Source§

fn try_encoded_len(&self) -> Result<u32, EncodeError>

Compute the encoded byte size, returning an error instead of panicking if it exceeds the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Read more
Source§

fn encode_length_delimited(&self, buf: &mut impl EncodeSink)

Encode this message as a length-delimited byte sequence. Read more
Source§

fn try_encode_length_delimited( &self, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>

Encode as a length-delimited byte sequence, returning an error instead of panicking if the encoded size exceeds the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>

Encode this message to a new Vec<u8>. Read more
Source§

fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>

Encode to a new Vec<u8>, returning an error instead of panicking if the encoded size exceeds the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Read more
Source§

fn encode_to_bytes(&self) -> Bytes

Encode this message to a new bytes::Bytes. Read more
Source§

fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>

Encode to a new bytes::Bytes, returning an error instead of panicking if the encoded size exceeds the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Read more
Source§

fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>
where Self: Sized,

Decode a message from a buffer.
Source§

fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>
where Self: Sized,

Decode a message from a byte slice. Read more
Source§

fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>
where Self: Sized,

Decode a length-delimited message from a buffer. Read more
Source§

fn merge_to_limit( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, limit: usize, ) -> Result<(), DecodeError>

Merge fields from a buffer until buf.remaining() reaches limit. Read more
Source§

fn merge_group( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, field_number: u32, ) -> Result<(), DecodeError>

Merges a group-encoded message from buf, reading fields until an EndGroup tag with the given field_number is encountered. Read more
Source§

fn merge( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>

Merge fields from a buffer into this message. Read more
Source§

fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>

Merge fields from a byte slice into this message. Read more
Source§

fn merge_length_delimited( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>

Merge fields from a length-delimited sub-message payload into this message. Read more
Source§

impl PartialEq for ContainerFormat

Source§

fn eq(&self, other: &ContainerFormat) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ContainerFormat

Available on crate feature serde only.
Source§

fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ContainerFormat

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.