#[non_exhaustive]pub enum Error {
Show 24 variants
Memory,
DstTooSmall,
SrcTooSmall,
BadMagic,
BadVersion,
BadHeader,
BadChecksum,
CorruptData,
BadOffset,
Overflow,
Io,
NullInput,
BadBlockType,
BadBlockSize,
DictRequired,
DictMismatch,
DictTooLarge,
BadLevel,
DictUnsupported,
BadParam,
BadHufTable,
Unsupported(&'static str),
InvalidData,
Unknown(i32),
}Expand description
Errors that can occur during ZXC operations.
Marked #[non_exhaustive]: new variants may be added in minor releases,
so keep a wildcard arm when matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Memory
Memory allocation failure
DstTooSmall
Destination buffer too small
SrcTooSmall
Source buffer too small or truncated input
BadMagic
Invalid magic word in file header
BadVersion
Unsupported file format version
BadHeader
Corrupted or invalid header (checksum mismatch)
BadChecksum
A block’s decoded bytes fail its checksum, or the archive digest mismatches
CorruptData
Corrupted compressed data
BadOffset
Invalid match offset during decompression
Overflow
Buffer overflow detected during processing
Io
Read/write/seek failure on file
NullInput
Required input pointer is NULL
BadBlockType
Unknown or unexpected block type
BadBlockSize
Invalid block size
DictRequired
The archive requires a dictionary but none was provided
DictMismatch
The provided dictionary does not match the archive’s dictionary ID
DictTooLarge
The dictionary exceeds the maximum allowed size
BadLevel
The compression level is out of range or unsupported by this context
DictUnsupported
Dictionary not supported by this context’s workspace (static contexts)
BadParam
A context parameter is unknown or its value out of bounds (e.g. a thread count above the library maximum)
BadHufTable
Shared literal Huffman table is not ZXC_HUF_TABLE_SIZE bytes
Unsupported(&'static str)
The requested options are not supported by this API
InvalidData
The compressed data appears to be invalid or truncated
Unknown(i32)
Unknown error code from C library
Trait Implementations§
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()