#[non_exhaustive]pub enum SecretKeyError {
Hex(HexError),
InvalidLength(usize),
InvalidScalar,
Rng(RngError),
}Expand description
Errors raised when constructing a SecretKey.
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.
Hex(HexError)
The hex representation could not be decoded.
InvalidLength(usize)
The byte slice was not exactly SECRET_KEY_SIZE long.
InvalidScalar
The bytes did not encode a valid secp256k1 scalar (0 or >= n).
Rng(RngError)
The OS entropy source failed.
Trait Implementations§
Source§impl Clone for SecretKeyError
impl Clone for SecretKeyError
Source§fn clone(&self) -> SecretKeyError
fn clone(&self) -> SecretKeyError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SecretKeyError
Source§impl Debug for SecretKeyError
impl Debug for SecretKeyError
Source§impl Display for SecretKeyError
impl Display for SecretKeyError
Source§impl Error for SecretKeyError
impl Error for SecretKeyError
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<HexError> for SecretKeyError
impl From<HexError> for SecretKeyError
Source§impl From<RngError> for SecretKeyError
impl From<RngError> for SecretKeyError
Source§impl From<SecretKeyError> for FromBech32Error
impl From<SecretKeyError> for FromBech32Error
Source§fn from(source: SecretKeyError) -> Self
fn from(source: SecretKeyError) -> Self
Converts to this type from the input type.
Source§impl From<SecretKeyError> for Nip49Error
Available on crate feature nip49 only.
impl From<SecretKeyError> for Nip49Error
Available on crate feature
nip49 only.Source§fn from(source: SecretKeyError) -> Self
fn from(source: SecretKeyError) -> Self
Converts to this type from the input type.
Source§impl From<SecretKeyError> for Nip60Error
Available on crate feature nip44 only.
impl From<SecretKeyError> for Nip60Error
Available on crate feature
nip44 only.Source§fn from(source: SecretKeyError) -> Self
fn from(source: SecretKeyError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SecretKeyError
impl RefUnwindSafe for SecretKeyError
impl Send for SecretKeyError
impl Sync for SecretKeyError
impl Unpin for SecretKeyError
impl UnsafeUnpin for SecretKeyError
impl UnwindSafe for SecretKeyError
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