#[non_exhaustive]pub enum SignerError {
AuthorMismatch(UnsignedEventError),
Rejected {
message: String,
code: Option<String>,
},
Backend(Box<dyn StdError + Send + Sync>),
Unsupported(&'static str),
}Expand description
Errors raised by a NostrSigner.
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.
AuthorMismatch(UnsignedEventError)
The signer’s public key did not match the unsigned event author.
Rejected
The remote signer rejected the request (e.g. user denied a NIP-46
prompt, NIP-07 returned null, …).
code carries the machine-readable NIP-46 error string when the
backend supplies one ("user_rejected", "timeout", etc.); leave
it None for backends without a structured error channel.
Fields
Backend(Box<dyn StdError + Send + Sync>)
The signer could not communicate with its backend.
Unsupported(&'static str)
The signer does not implement the requested operation.
Implementations§
Source§impl SignerError
impl SignerError
Sourcepub fn rejected<S>(message: S) -> Self
pub fn rejected<S>(message: S) -> Self
Convenience constructor for SignerError::Rejected without a
structured backend code (NIP-07, sandbox signers, etc.).
Sourcepub fn rejected_with_code<S, C>(message: S, code: C) -> Self
pub fn rejected_with_code<S, C>(message: S, code: C) -> Self
Convenience constructor for SignerError::Rejected with a
machine-readable code (typically the NIP-46 error string).
Trait Implementations§
Source§impl Debug for SignerError
impl Debug for SignerError
Source§impl Display for SignerError
impl Display for SignerError
Source§impl Error for SignerError
impl Error for SignerError
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<UnsignedEventError> for SignerError
impl From<UnsignedEventError> for SignerError
Source§fn from(source: UnsignedEventError) -> Self
fn from(source: UnsignedEventError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for SignerError
impl !UnwindSafe for SignerError
impl Freeze for SignerError
impl Send for SignerError
impl Sync for SignerError
impl Unpin for SignerError
impl UnsafeUnpin for SignerError
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