pub enum TlvError {
UnexpectedEof,
UnknownCriticalType(u64),
InvalidLength {
typ: u64,
expected: usize,
got: usize,
},
InvalidUtf8 {
typ: u64,
},
MissingField(&'static str),
DuplicateField(u64),
NonMinimalVarNumber,
}Expand description
Errors produced by TLV decoding.
Variants§
UnexpectedEof
Packet was truncated before the expected end.
UnknownCriticalType(u64)
Unknown TLV type with the critical bit set (odd type number) — must drop.
InvalidLength
A field had the wrong encoded length.
InvalidUtf8
A UTF-8 field contained invalid bytes.
MissingField(&'static str)
A required field was absent.
DuplicateField(u64)
The same TLV type appeared more than once where only one is allowed.
NonMinimalVarNumber
VarNumber is not in shortest encoding form.
Trait Implementations§
Source§impl Error for TlvError
impl Error for TlvError
1.30.0 · 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()
impl Eq for TlvError
impl StructuralPartialEq for TlvError
Auto Trait Implementations§
impl Freeze for TlvError
impl RefUnwindSafe for TlvError
impl Send for TlvError
impl Sync for TlvError
impl Unpin for TlvError
impl UnwindSafe for TlvError
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