#[non_exhaustive]pub enum Error {
Truncated,
BadMagic,
Reserved,
WindowTooLarge,
MissingDictionary,
WrongDictionary,
OutputLimit,
Checksum,
ContentSize,
Corrupt(&'static str),
BadDictionary(&'static str),
Parameter(&'static str),
}Expand description
What went wrong. Decoding never panics on malformed input; it returns one of these.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The input ended before a complete structure could be read.
BadMagic
The input does not start with a zstd or skippable frame magic number.
Reserved
A reserved bit or field was set.
WindowTooLarge
The frame’s window is larger than the decoder accepts.
MissingDictionary
The frame requires a dictionary but none was supplied.
WrongDictionary
The frame names a dictionary ID different from the supplied dictionary’s.
OutputLimit
Decoding would exceed the caller’s output limit (decompression-bomb guard).
Checksum
The frame’s XXH64 checksum does not match the decoded content.
ContentSize
The decoded size disagrees with the frame’s declared content size.
Corrupt(&'static str)
The compressed data is internally inconsistent; the reason is static text.
BadDictionary(&'static str)
A dictionary could not be parsed.
Parameter(&'static str)
A caller-supplied parameter is out of range; the reason is static text.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()