#[non_exhaustive]pub enum ParseEventError {
MalformedJson,
InvalidId,
InvalidPubkey,
InvalidSignature,
EmptyTag,
UnsupportedCharacter,
IdMismatch,
BadSignature,
}Expand description
The reasons event JSON can fail to parse or verify.
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.
MalformedJson
The input is not a single JSON object with exactly the seven NIP-01
fields of the right types. A positional array, duplicate and unknown
fields and trailing data are rejected, and kind must fit in 16 bits.
InvalidId
The id field is not 64 lowercase hexadecimal digits.
InvalidPubkey
The pubkey field is not 64 lowercase hex digits naming a valid
x-only point.
InvalidSignature
The sig field is not 128 lowercase hexadecimal digits.
EmptyTag
A tag has no elements; NIP-01 requires at least one.
UnsupportedCharacter
The content or a tag contains a control character outside the set
NIP-01 escapes by name; see
SignedEvent.
IdMismatch
The id field is not the NIP-01 hash of the event.
BadSignature
The signature does not verify over the event ID with the pubkey.
Trait Implementations§
Source§impl Clone for ParseEventError
impl Clone for ParseEventError
impl Copy for ParseEventError
Source§impl Debug for ParseEventError
impl Debug for ParseEventError
Source§impl Display for ParseEventError
impl Display for ParseEventError
impl Eq for ParseEventError
Source§impl Error for ParseEventError
impl Error for ParseEventError
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 From<ParseEventError> for VerifyRequestError
impl From<ParseEventError> for VerifyRequestError
Source§fn from(source: ParseEventError) -> Self
fn from(source: ParseEventError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ParseEventError
impl PartialEq for ParseEventError
impl StructuralPartialEq for ParseEventError
Auto Trait Implementations§
impl Forget for ParseEventError
impl Freeze for ParseEventError
impl Move for ParseEventError
impl RefUnwindSafe for ParseEventError
impl Send for ParseEventError
impl Sync for ParseEventError
impl Unpin for ParseEventError
impl UnsafeUnpin for ParseEventError
impl UnwindSafe for ParseEventError
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