#[non_exhaustive]pub enum ErrorCode {
PrefixUnknown,
FrameParameterUnsupported,
FrameParameterWindowTooLarge,
ParameterOutOfBound,
DictionaryCorrupted,
DictionaryWrong,
DstSizeTooSmall,
InitMissing,
ChecksumWrong,
SrcSizeWrong,
CorruptionDetected,
}Expand description
The class a decoding failure falls in, as libzstd’s stable error codes name
it (zstd_errors.h). The C API returns these codes and the command line
prints ErrorCode::message, so both report a failure alike.
§Examples
use structured_zstd::decoding::errors::{ErrorCode, FrameDecoderError};
let err = FrameDecoderError::DictNotProvided { dict_id: 7 };
assert_eq!(err.code(), ErrorCode::DictionaryWrong);
assert_eq!(err.code().message(), "Dictionary mismatch");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PrefixUnknown
Not a frame: the magic number is unknown.
FrameParameterUnsupported
The frame header asks for something this decoder does not support.
FrameParameterWindowTooLarge
The frame’s window is past the ceiling in force.
ParameterOutOfBound
A setting lies outside its allowed range.
DictionaryCorrupted
The dictionary could not be read.
DictionaryWrong
The frame needs another dictionary than the one supplied, or one that was not supplied.
DstSizeTooSmall
The output buffer is too small.
InitMissing
The decoder was used before a frame was started.
ChecksumWrong
The content checksum does not match the decoded data.
SrcSizeWrong
The input ends inside the frame.
CorruptionDetected
The frame is malformed or damaged.
Implementations§
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more