#[non_exhaustive]pub enum DecodeSkippableFrameError {
Magic(Error),
BadMagicNumber(u32),
Length(Error),
Payload(Error),
AllocationFailed {
requested: usize,
},
PayloadTooLarge {
length: u32,
},
}lsm only.Expand description
Errors surfaced when reading a SkippableFrame from a stream.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Magic(Error)
I/O error while reading the 4-byte magic prefix.
BadMagicNumber(u32)
First 4 bytes are not a skippable-frame magic in the
0x184D2A50..=0x184D2A5F range.
Length(Error)
I/O error while reading the 4-byte length field.
Payload(Error)
I/O error while reading the payload bytes.
AllocationFailed
Allocation of the payload buffer failed (e.g. a crafted
length field requested more memory than is available).
requested is the byte count the on-wire length field
asked for.
PayloadTooLarge
Wire-format length field is not representable on this
target’s usize width: either usize::try_from(length)
fails outright (16-bit targets where the declared length
exceeds u16::MAX) or length + SKIPPABLE_HEADER_SIZE
would overflow usize (32-bit targets where the declared
length sits near u32::MAX). On 64-bit every u32 length
is representable and this variant is unreachable.
length is the raw wire-format u32 value from the
length field — preserved exactly so callers can diagnose
what the stream declared, without any narrowing cast.
Trait Implementations§
Source§impl Debug for DecodeSkippableFrameError
impl Debug for DecodeSkippableFrameError
Source§impl Display for DecodeSkippableFrameError
impl Display for DecodeSkippableFrameError
Source§impl Error for DecodeSkippableFrameError
impl Error for DecodeSkippableFrameError
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()