#[non_exhaustive]pub enum DecodeBufferError {
NotEnoughBytesInDictionary {
got: usize,
need: usize,
},
OffsetTooBig {
offset: usize,
buf_len: usize,
},
ZeroOffset,
BackendOverflow,
OutputBufferOverflow {
tail: usize,
requested: usize,
capacity: usize,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotEnoughBytesInDictionary
OffsetTooBig
ZeroOffset
BackendOverflow
Legacy unit variant kept for binary compatibility with earlier
snapshots of this enum. Not surfaced from any current
production path — BufferBackend::try_extend /
try_extend_from_within and the new try_reserve (used by
DecodeBuffer::repeat) carry their failures through the
richer Self::OutputBufferOverflow variant below, which
reports the offending tail / requested / capacity
triple. New code should pattern-match on
OutputBufferOverflow; this unit variant is retained to keep
the #[non_exhaustive] enum’s existing discriminant set
stable.
OutputBufferOverflow
Repeat-side match copy would write past the writable tail of
a fixed-capacity backend (UserSliceBackend). Surfaced by
[super::decode_buffer::DecodeBuffer::repeat] / _lookahead
when the new BufferBackend::try_reserve rejects the
pre-write capacity check — keeping the safe public decode
APIs error-returning instead of panicking via the per-call
assert! inside extend_from_within_unchecked. Growable
backends (FlatBuf, RingBuffer) never produce this; their
try_reserve falls through to infallible reserve.
Trait Implementations§
Source§impl Debug for DecodeBufferError
impl Debug for DecodeBufferError
Source§impl Display for DecodeBufferError
impl Display for DecodeBufferError
Source§impl Error for DecodeBufferError
Available on crate feature std only.
impl Error for DecodeBufferError
std only.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()