#[non_exhaustive]pub enum EncodingError {
InvalidHex,
InvalidLength {
what: &'static str,
expected: usize,
actual: usize,
},
UnexpectedEnd,
NonCanonicalCompactSize {
value: u64,
len: usize,
},
CompactSizeTooLarge,
CompactSize64,
}Expand description
A malformed encoding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidHex
The string is not valid hex (odd length or a non-hex character).
InvalidLength
A value has the wrong length.
Fields
UnexpectedEnd
The input ended before the value being read.
NonCanonicalCompactSize
A CompactSize was not minimally encoded (consensus rejects these).
CompactSizeTooLarge
A CompactSize exceeded MAX_COMPACT_SIZE.
CompactSize64
A CompactSize used the 64-bit (0xff) form.
Trait Implementations§
Source§impl Clone for EncodingError
impl Clone for EncodingError
Source§impl Debug for EncodingError
impl Debug for EncodingError
Source§impl Display for EncodingError
impl Display for EncodingError
impl Eq for EncodingError
Source§impl Error for EncodingError
impl Error for EncodingError
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()
Source§impl From<EncodingError> for Error
impl From<EncodingError> for Error
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Source§impl From<EncodingError> for Error
impl From<EncodingError> for Error
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Source§impl From<EncodingError> for KeyError
impl From<EncodingError> for KeyError
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Source§impl From<EncodingError> for Error
impl From<EncodingError> for Error
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Source§impl From<EncodingError> for Error
impl From<EncodingError> for Error
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EncodingError
impl PartialEq for EncodingError
impl StructuralPartialEq for EncodingError
Auto Trait Implementations§
impl Freeze for EncodingError
impl RefUnwindSafe for EncodingError
impl Send for EncodingError
impl Sync for EncodingError
impl Unpin for EncodingError
impl UnsafeUnpin for EncodingError
impl UnwindSafe for EncodingError
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