pub enum CodecError {
Io(String),
Format(String),
Decode(String),
Eof,
InvalidSampleRate(u32),
InvalidChannelCount(u16),
BufferTooSmall {
needed: usize,
have: usize,
},
}Expand description
Errors that can arise when opening or decoding an audio container.
All variants carry enough information to build a useful diagnostic without
exposing backend-specific error types (std::io::Error is not Eq, so it
is converted to a String at the boundary).
Variants§
Io(String)
An I/O failure occurred (file open, read, seek).
Format(String)
The container format is unsupported or could not be recognised.
Decode(String)
A decode failure occurred (corrupt stream or malformed packet).
Eof
The end of the stream was reached where more data was expected.
ContainerDecoder::next_frame
returns Ok(None) for normal end-of-stream; this variant is reserved
for callers that treat EOF as a hard error.
InvalidSampleRate(u32)
The sample rate is zero or otherwise unsupported.
InvalidChannelCount(u16)
The channel count is zero or otherwise unsupported.
BufferTooSmall
A destination buffer was smaller than required.
Trait Implementations§
Source§impl Clone for CodecError
impl Clone for CodecError
Source§fn clone(&self) -> CodecError
fn clone(&self) -> CodecError
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 CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
impl Eq for CodecError
Source§impl Error for CodecError
impl Error for CodecError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()