#[non_exhaustive]pub enum FrameError {
UnsupportedVersion(u8),
UnknownFrameType(u8),
PayloadTooLarge {
requested: usize,
limit: usize,
},
Decompression(String),
DecompressedTooLarge {
limit: usize,
},
Compression(String),
}Expand description
Errors that can occur while encoding or decoding a Lumberjack v2 frame.
All variants are non-exhaustive in spirit: future versions of the codec
may add new variants without bumping the major version while in the
v0.0.x series.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedVersion(u8)
Wire byte 0 is not b'2'. The decoder refuses to advance because
it cannot determine which protocol version applies.
UnknownFrameType(u8)
Wire byte 1 is not a known frame type.
PayloadTooLarge
A length field declared a frame larger than
crate::DEFAULT_MAX_FRAME_PAYLOAD (or the configured per-decoder
limit). Surfaces resource-exhaustion attacks before the decoder
allocates.
Decompression(String)
Decompression failed (C frame had invalid zlib content).
DecompressedTooLarge
The decompressed contents of a C frame would exceed the
per-decoder size limit. Caps zlib-bomb input.
Compression(String)
The compressor returned an error while encoding (typically out of
memory). Returned only by crate::encode_compressed.
Trait Implementations§
Source§impl Debug for FrameError
impl Debug for FrameError
Source§impl Display for FrameError
impl Display for FrameError
Source§impl Error for FrameError
impl Error for FrameError
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()