#[non_exhaustive]pub enum ErrorKind {
Show 20 variants
InvalidBlockType,
InvalidStoredLength,
InvalidCodeLengths,
InvalidSymbol,
DistanceTooFar,
UnexpectedEnd,
OutputLimit,
RatioLimit,
TrailingData,
InvalidWindowBits,
InvalidLevel,
InvalidHeader,
ChecksumMismatch,
LengthMismatch,
HeaderTooLarge,
TooManyMembers,
DictionaryRequired,
WrongDictionary,
InvalidState,
AllocationFailed,
}Expand description
What went wrong, as a stable, matchable value.
Every kind says what to do in its message and has a
stable code for logs and metrics. New kinds may be
added in minor releases, so match with a wildcard arm.
§Examples
use compress_lib::ErrorKind;
assert_eq!(ErrorKind::OutputLimit.code(), "compress.output_limit");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidBlockType
A DEFLATE block header names block type 3, which does not exist.
InvalidStoredLength
A stored block’s length and its one’s complement disagree.
InvalidCodeLengths
A Huffman code description is invalid: over-subscribed, incomplete where the format forbids it, a repeat with no previous length, or a repeat that runs past the end of the table.
InvalidSymbol
A code decodes to a symbol the format reserves (length symbols 286 and 287, distance symbols 30 and 31) or to no symbol at all.
DistanceTooFar
A back-reference points before the start of the data (and any preset dictionary) or further back than the window allows.
UnexpectedEnd
The input ended inside the stream: the data is truncated.
OutputLimit
The output reached the configured max_output before the stream
ended.
RatioLimit
The output grew past the configured ratio to the input consumed.
TrailingData
Bytes follow the end of the stream where none are allowed.
InvalidWindowBits
A window size outside 8 to 15 bits was asked for, or a zlib header names a window larger than the decoder allows.
InvalidLevel
A compression level outside 0 to 9 was asked for.
InvalidHeader
A zlib or gzip header is malformed.
ChecksumMismatch
A checksum (Adler-32, CRC-32, or the gzip header CRC) does not match the data.
LengthMismatch
The gzip trailer’s length does not match the data.
HeaderTooLarge
The gzip header’s optional fields are larger than the configured cap.
TooManyMembers
A gzip stream has more members than the configured cap.
DictionaryRequired
A zlib stream needs a preset dictionary that was not given.
WrongDictionary
The preset dictionary given is not the one the zlib stream names.
InvalidState
The call is not valid in the engine’s current state.
AllocationFailed
The allocator refused memory for output.