#[non_exhaustive]pub enum DecodeError {
NoFrame,
ReservoirUnavailable(FrameInfo),
Corrupt(FrameInfo),
UnsupportedLayer(FrameInfo),
}Expand description
Why Decoder::decode produced no audio.
Every variant except NoFrame carries the frame’s header information.
NoFrame at the end of the input and ReservoirUnavailable right after
starting or seeking are part of normal decoding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoFrame
The input holds no complete frame, so the consumed bytes (all of the input, unless it was empty) were skipped as tags or junk. At the end of a stream this means there’s nothing left; mid-stream, the input was cut short or corrupt.
The frame uses bit-reservoir data from earlier frames that weren’t decoded, as happens for the first frame or two after starting in the middle of a stream or seeking. Later frames decode normally.
Corrupt(FrameInfo)
The frame is corrupt and was skipped.
UnsupportedLayer(FrameInfo)
The frame is Layer I or II and the layer12 feature is disabled.
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub fn frame_info(&self) -> Option<&FrameInfo>
pub fn frame_info(&self) -> Option<&FrameInfo>
The header information of the skipped frame, if there was one.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
impl Copy for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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()