#[non_exhaustive]pub enum ParseKeyError {
InvalidHex,
InvalidBech32,
WrongBech32Prefix,
InvalidLength,
OutOfRange,
}Expand description
The reasons a secret key can fail to parse.
No variant carries any part of the input.
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 text is not exactly 64 lowercase hexadecimal digits.
InvalidBech32
The string is not valid bech32 with a bech32 (not bech32m) checksum and zero padding bits.
WrongBech32Prefix
The bech32 prefix is not nsec.
InvalidLength
The decoded payload is not 32 bytes.
OutOfRange
The value is zero or not below the secp256k1 group order.
Trait Implementations§
Source§impl Clone for ParseKeyError
impl Clone for ParseKeyError
impl Copy for ParseKeyError
Source§impl Debug for ParseKeyError
impl Debug for ParseKeyError
Source§impl Display for ParseKeyError
impl Display for ParseKeyError
impl Eq for ParseKeyError
Source§impl Error for ParseKeyError
impl Error for ParseKeyError
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 PartialEq for ParseKeyError
impl PartialEq for ParseKeyError
impl StructuralPartialEq for ParseKeyError
Auto Trait Implementations§
impl Forget for ParseKeyError
impl Freeze for ParseKeyError
impl Move for ParseKeyError
impl RefUnwindSafe for ParseKeyError
impl Send for ParseKeyError
impl Sync for ParseKeyError
impl Unpin for ParseKeyError
impl UnsafeUnpin for ParseKeyError
impl UnwindSafe for ParseKeyError
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