#[non_exhaustive]pub enum ParseDidError {
MissingPrefix,
InvalidHex,
InvalidBech32,
WrongBech32Prefix,
InvalidLength,
NotOnCurve,
}Expand description
The reasons a did:nostr principal can fail to parse.
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.
MissingPrefix
The text does not start with did:nostr:.
InvalidHex
The key 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 npub.
InvalidLength
The decoded payload is not 32 bytes.
NotOnCurve
The bytes are not the x-coordinate of a point on secp256k1.
Trait Implementations§
Source§impl Clone for ParseDidError
impl Clone for ParseDidError
impl Copy for ParseDidError
Source§impl Debug for ParseDidError
impl Debug for ParseDidError
Source§impl Display for ParseDidError
impl Display for ParseDidError
impl Eq for ParseDidError
Source§impl Error for ParseDidError
impl Error for ParseDidError
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 ParseDidError
impl PartialEq for ParseDidError
impl StructuralPartialEq for ParseDidError
Auto Trait Implementations§
impl Forget for ParseDidError
impl Freeze for ParseDidError
impl Move for ParseDidError
impl RefUnwindSafe for ParseDidError
impl Send for ParseDidError
impl Sync for ParseDidError
impl Unpin for ParseDidError
impl UnsafeUnpin for ParseDidError
impl UnwindSafe for ParseDidError
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