#[non_exhaustive]pub enum Error {
Show 13 variants
UnknownFrame,
Truncated,
Corrupted,
ChecksumMismatch,
UnsupportedFrameParameter,
WindowTooLarge,
DictionaryMismatch,
InvalidDictionary,
OutputTooSmall,
OutputTooLarge,
SrcSizeWrong,
StageWrong,
MemoryAllocation,
}Expand description
Errors returned by the decoder and the encoder.
Corrupt input never panics or reads out of bounds; it returns one of these.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownFrame
The input doesn’t start with a zstd (or skippable) frame magic number.
Truncated
The input ends before the frame does.
Corrupted
The compressed data is corrupt.
ChecksumMismatch
The frame’s content checksum doesn’t match the decompressed data.
UnsupportedFrameParameter
The frame header uses a reserved bit or an unsupported parameter.
WindowTooLarge
The frame’s window is larger than the decoder’s limit.
DictionaryMismatch
The frame needs a dictionary that wasn’t given, or a different one.
InvalidDictionary
A dictionary given to the decoder is invalid.
OutputTooSmall
The output buffer is too small for the decompressed data.
OutputTooLarge
The decompressed size is larger than this platform can hold in memory.
SrcSizeWrong
The compressor got a different amount of input than the pledged source size.
StageWrong
The operation is not possible at this stage of a stream (for example, setting the pledged source size in the middle of a frame).
MemoryAllocation
The buffers the compression parameters need don’t fit in this
platform’s memory (libzstd’s memory_allocation error): for
example, multithreaded compression with a large job size and many
workers on a 32-bit target.
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()