pub enum FlacError {
NotFlac,
Truncated,
CorruptStream(String),
Unsupported(String),
CrcMismatch,
LimitExceeded(String),
InvalidInput(String),
}Expand description
Errors returned when decoding or encoding a FLAC stream.
Variants§
NotFlac
The input does not begin with the fLaC stream marker.
Truncated
The stream ended in the middle of a field that was still being read.
CorruptStream(String)
A structural value in the stream is impossible or out of range (an unknown subframe type, a reserved code, a partition order that does not divide the block, and so on). The string names the specific fault.
Unsupported(String)
The stream uses a feature this crate does not implement (for example a reserved sample-rate or bit-depth code, or Ogg encapsulation).
CrcMismatch
A computed CRC did not match the value stored in the stream, so the data is damaged.
LimitExceeded(String)
The stream is structurally valid but asks the decoder to produce more than a built-in safety limit allows (for example a sample total or a run of maximum-size constant subframes that would exhaust memory). The string names the limit that was hit.
InvalidInput(String)
The samples handed to the encoder are inconsistent (channel lengths differ, bit depth out of range, no channels, and so on). The string names the specific fault.
Trait Implementations§
impl Eq for FlacError
Source§impl Error for FlacError
impl Error for FlacError
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()