pub enum ZlibError {
UnexpectedEof,
UnsupportedMethod(u8),
InvalidWindowSize(u8),
InvalidHeaderCheck,
PresetDictionary,
Inflate(InflateError),
ChecksumMismatch {
expected: u32,
actual: u32,
},
TrailingData {
len: usize,
},
}Expand description
An error found while decoding a zlib stream.
Variants§
UnexpectedEof
The input ended inside the header or the checksum trailer.
UnsupportedMethod(u8)
The header names a compression method other than DEFLATE (8).
InvalidWindowSize(u8)
The header declares a window larger than 32 KiB.
InvalidHeaderCheck
The header’s check bits are wrong (CMF * 256 + FLG is not a
multiple of 31).
PresetDictionary
The stream needs a preset dictionary, which is not supported.
Inflate(InflateError)
The compressed data is malformed.
ChecksumMismatch
The Adler-32 of the decompressed data does not match the trailer.
TrailingData
Bytes follow the end of the stream.
Trait Implementations§
impl Copy for ZlibError
impl Eq for ZlibError
Source§impl Error for ZlibError
impl Error for ZlibError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<InflateError> for ZlibError
impl From<InflateError> for ZlibError
Source§fn from(error: InflateError) -> Self
fn from(error: InflateError) -> Self
Converts to this type from the input type.
Source§impl From<ZlibError> for DecodeError
impl From<ZlibError> for DecodeError
impl StructuralPartialEq for ZlibError
Auto Trait Implementations§
impl Forget for ZlibError
impl Freeze for ZlibError
impl Move for ZlibError
impl RefUnwindSafe for ZlibError
impl Send for ZlibError
impl Sync for ZlibError
impl Unpin for ZlibError
impl UnsafeUnpin for ZlibError
impl UnwindSafe for ZlibError
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