#[non_exhaustive]pub enum Error {
EndOfStream,
Truncated,
Parse(&'static str),
Unsupported(String),
Limits,
Io(Error),
BadInput,
}Expand description
Errors reported by the decoder and encoder.
Every malformed, truncated, or over-budget input maps to a typed variant, so callers can branch on truncation versus clean end of stream.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EndOfStream
Clean end of stream: EOF exactly where a FRAME header would start,
or EOF while reading the stream header before any frame was decoded.
Truncated
EOF inside a frame header or frame payload: the stream was cut off mid-frame.
Parse(&'static str)
A header byte sequence violates the YUV4MPEG2 grammar. The payload names the offending location or rule.
Unsupported(String)
A C (colorspace) tag with a value this crate does not recognize.
The payload holds the tag value as read from the wire.
Limits
A header line or frame byte budget was exceeded, or plane size arithmetic overflowed.
Io(Error)
An I/O error other than UnexpectedEof from the underlying reader or
writer.
BadInput
Writer input validation failure: plane length mismatch, invalid extension bytes, or an out-of-range sample.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()