Enum strict_encoding::TlvError
source · pub enum TlvError {
Order {
read: u64,
max: u64,
},
Len {
expected: u64,
actual: u64,
},
Repeated(u64),
UnknownEvenType(u64),
}
Expand description
Possible errors during TLV extension encoding and decoding process
Variants
Order
Fields
read: u64
TLV type id read at the current position
max: u64
maximum value of TLV type id read previously
deterministic order of TLV records is broken: type {read} follows after type {max}
Len
Fields
expected: u64
TLV value length encoded in the TLV record
actual: u64
Actual remaining length of the TLV stream
incorrect length of TLV record value: expected {expected}, but only {actual} bytes read
Repeated(u64)
repeated TLV record with id {0}
UnknownEvenType(u64)
an unknown even TLV type {0}
Trait Implementations
sourceimpl Error for TlvError
impl Error for TlvError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
sourceimpl Ord for TlvError
impl Ord for TlvError
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<TlvError> for TlvError
impl PartialOrd<TlvError> for TlvError
sourcefn partial_cmp(&self, other: &TlvError) -> Option<Ordering>
fn partial_cmp(&self, other: &TlvError) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for TlvError
impl StructuralEq for TlvError
impl StructuralPartialEq for TlvError
Auto Trait Implementations
impl RefUnwindSafe for TlvError
impl Send for TlvError
impl Sync for TlvError
impl Unpin for TlvError
impl UnwindSafe for TlvError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more