#[non_exhaustive]pub enum FromBech32Error {
Show 14 variants
TooLong {
len: usize,
max: usize,
},
Decode(CheckedHrpstringError),
UnknownHrp(String),
UnexpectedHrp {
expected: &'static str,
got: String,
},
InvalidPayloadLength {
expected: usize,
got: usize,
},
MissingTlv {
tag: u8,
},
InvalidKindLength {
got: usize,
},
KindOutOfRange {
raw: u32,
},
InvalidRelayUtf8(Utf8Error),
Tlv(TlvError),
PublicKey(PublicKeyError),
SecretKey(SecretKeyError),
EventId(EventIdError),
RelayUrl(RelayUrlError),
}Expand description
Error produced when decoding a NIP-19 string.
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.
TooLong
The input exceeded MAX_NIP19_LENGTH.
Decode(CheckedHrpstringError)
The string is not valid bech32 with the expected checksum.
UnknownHrp(String)
The HRP is not one of the NIP-19 prefixes.
UnexpectedHrp
The HRP did not match the expected entity type.
InvalidPayloadLength
A fixed-size payload had the wrong length.
MissingTlv
A required TLV record was missing.
InvalidKindLength
A kind TLV had the wrong length (must be 4 bytes).
KindOutOfRange
A kind TLV held a value that exceeds u16::MAX; nula’s Kind
only stores 16-bit kinds even though NIP-19 reserves 32 bits.
InvalidRelayUtf8(Utf8Error)
A relay TLV was not valid UTF-8.
Tlv(TlvError)
Forwarded TLV decoding error.
PublicKey(PublicKeyError)
Forwarded public-key validation error.
SecretKey(SecretKeyError)
Forwarded secret-key validation error.
EventId(EventIdError)
Forwarded event-id validation error.
RelayUrl(RelayUrlError)
Forwarded relay-URL validation error.
Trait Implementations§
Source§impl Debug for FromBech32Error
impl Debug for FromBech32Error
Source§impl Display for FromBech32Error
impl Display for FromBech32Error
Source§impl Error for FromBech32Error
impl Error for FromBech32Error
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<CheckedHrpstringError> for FromBech32Error
impl From<CheckedHrpstringError> for FromBech32Error
Source§fn from(source: CheckedHrpstringError) -> Self
fn from(source: CheckedHrpstringError) -> Self
Converts to this type from the input type.
Source§impl From<EventIdError> for FromBech32Error
impl From<EventIdError> for FromBech32Error
Source§fn from(source: EventIdError) -> Self
fn from(source: EventIdError) -> Self
Converts to this type from the input type.
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<PublicKeyError> for FromBech32Error
impl From<PublicKeyError> for FromBech32Error
Source§fn from(source: PublicKeyError) -> Self
fn from(source: PublicKeyError) -> Self
Converts to this type from the input type.
Source§impl From<RelayUrlError> for FromBech32Error
impl From<RelayUrlError> for FromBech32Error
Source§fn from(source: RelayUrlError) -> Self
fn from(source: RelayUrlError) -> Self
Converts to this type from the input type.
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<TlvError> for FromBech32Error
impl From<TlvError> for FromBech32Error
Auto Trait Implementations§
impl Freeze for FromBech32Error
impl RefUnwindSafe for FromBech32Error
impl Send for FromBech32Error
impl Sync for FromBech32Error
impl Unpin for FromBech32Error
impl UnsafeUnpin for FromBech32Error
impl UnwindSafe for FromBech32Error
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