#[non_exhaustive]pub enum Nip21Error {
InvalidUri,
SecretKeyRefused,
Decode(FromBech32Error),
Encode(ToBech32Error),
}Expand description
Errors raised by the NIP-21 encoder / decoder.
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.
InvalidUri
The input did not start with nostr: or had an empty body.
SecretKeyRefused
The URI contained a bech32 secret key (nsec… or ncryptsec…),
which NIP-21 forbids on safety grounds.
Decode(FromBech32Error)
The bech32 body of the URI failed to decode.
Encode(ToBech32Error)
The NIP-19 encoder refused to re-encode the payload as bech32.
Trait Implementations§
Source§impl Debug for Nip21Error
impl Debug for Nip21Error
Source§impl Display for Nip21Error
impl Display for Nip21Error
Source§impl Error for Nip21Error
impl Error for Nip21Error
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<FromBech32Error> for Nip21Error
impl From<FromBech32Error> for Nip21Error
Source§fn from(source: FromBech32Error) -> Self
fn from(source: FromBech32Error) -> Self
Converts to this type from the input type.
Source§impl From<ToBech32Error> for Nip21Error
impl From<ToBech32Error> for Nip21Error
Source§fn from(source: ToBech32Error) -> Self
fn from(source: ToBech32Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Nip21Error
impl RefUnwindSafe for Nip21Error
impl Send for Nip21Error
impl Sync for Nip21Error
impl Unpin for Nip21Error
impl UnsafeUnpin for Nip21Error
impl UnwindSafe for Nip21Error
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