pub enum DecodeError {
Truncated {
offset: usize,
},
LengthMismatch {
offset: usize,
expected: usize,
available: usize,
},
UnknownOpcode {
byte: u8,
offset: usize,
},
UnknownValueTag {
tag: u8,
offset: usize,
},
InvalidString,
ReservedClockSentinel {
offset: usize,
},
UnknownSymbolKind {
ordinal: u8,
offset: usize,
},
BodyUnderflow {
opcode: Opcode,
offset: usize,
consumed: usize,
declared: usize,
},
VarintOverflow {
offset: usize,
},
NonCanonicalVarint {
offset: usize,
},
InvalidFlagBits {
byte: u8,
allowed_mask: u8,
offset: usize,
},
InvalidDiscriminant {
field: &'static str,
tag: u8,
offset: usize,
},
}Expand description
Errors produced by decode_record.
Variants§
Truncated
The input ended before the record was fully decoded.
LengthMismatch
The length-prefix said the body extended past the input.
Fields
UnknownOpcode
Opcode byte is not in the registered set.
UnknownValueTag
Value-tag byte is not in 0x01..=0x06.
InvalidString
A string value was not valid UTF-8.
ReservedClockSentinel
A ClockTime field on the wire carried the u64::MAX reserved
sentinel, which ClockTime refuses to construct. Only the
invalid_at slot is permitted to be None; every other clock
field must be a concrete millisecond value.
UnknownSymbolKind
A symbol-kind ordinal byte did not correspond to any variant.
BodyUnderflow
Record body declared more bytes than the body contained.
Fields
VarintOverflow
Varint decoding overflowed the target type (more than 10 bytes
for u64).
NonCanonicalVarint
Varint was well-formed but not encoded with the shortest byte sequence.
InvalidFlagBits
Reserved flag bits were set in a record flag byte.
Fields
InvalidDiscriminant
A field discriminant carried a value outside its canonical set.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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()
Source§impl From<DecodeError> for StoreError
impl From<DecodeError> for StoreError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl Eq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.