#[non_exhaustive]pub enum HexError {
InvalidHex,
#[non_exhaustive] InvalidLength {
expected: usize,
got: usize,
},
}Expand description
Errors from hex decoding. Variant shapes are identical in debug and release builds; only numeric length metadata is carried. Errors produced when decoding hexadecimal strings.
Requires feature encoding-hex.
Variant shapes are identical in debug and release builds; only numeric length metadata is carried.
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 hexadecimal.
#[non_exhaustive]InvalidLength
The decoded payload length does not match the target type’s length.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Trait Implementations§
impl Copy for HexError
impl Eq for HexError
Source§impl Error for HexError
Available on crate features encoding-hex and std only.
impl Error for HexError
Available on crate features
encoding-hex and std only.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 StructuralPartialEq for HexError
Auto Trait Implementations§
impl Freeze for HexError
impl RefUnwindSafe for HexError
impl Send for HexError
impl Sync for HexError
impl Unpin for HexError
impl UnsafeUnpin for HexError
impl UnwindSafe for HexError
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