#[non_exhaustive]pub enum CommentError {
UnexpectedKind(u16),
MissingRoot,
MissingParent,
MissingValue {
tag: &'static str,
},
InvalidKind(String),
InvalidEventId(EventIdError),
InvalidCoordinate(CoordinateError),
InvalidRelay(RelayUrlError),
InvalidPubkey(PublicKeyError),
}Expand description
Errors raised when parsing a NIP-22 comment event.
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.
UnexpectedKind(u16)
The event’s kind was not 1111.
MissingRoot
The event was missing a root scope tag (E/A/I).
MissingParent
The event was missing a parent scope tag (e/a/i).
MissingValue
A recognised tag was missing its value.
InvalidKind(String)
A K/k value did not parse as u16.
InvalidEventId(EventIdError)
An E/e tag’s id did not parse.
InvalidCoordinate(CoordinateError)
An A/a tag’s coordinate did not parse.
InvalidRelay(RelayUrlError)
A relay hint did not parse.
InvalidPubkey(PublicKeyError)
A P/p tag’s pubkey did not parse.
Trait Implementations§
Source§impl Clone for CommentError
impl Clone for CommentError
Source§fn clone(&self) -> CommentError
fn clone(&self) -> CommentError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommentError
impl Debug for CommentError
Source§impl Display for CommentError
impl Display for CommentError
Source§impl Error for CommentError
impl Error for CommentError
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<CoordinateError> for CommentError
impl From<CoordinateError> for CommentError
Source§fn from(source: CoordinateError) -> Self
fn from(source: CoordinateError) -> Self
Converts to this type from the input type.
Source§impl From<EventIdError> for CommentError
impl From<EventIdError> for CommentError
Source§fn from(source: EventIdError) -> Self
fn from(source: EventIdError) -> Self
Converts to this type from the input type.
Source§impl From<PublicKeyError> for CommentError
impl From<PublicKeyError> for CommentError
Source§fn from(source: PublicKeyError) -> Self
fn from(source: PublicKeyError) -> Self
Converts to this type from the input type.
Source§impl From<RelayUrlError> for CommentError
impl From<RelayUrlError> for CommentError
Source§fn from(source: RelayUrlError) -> Self
fn from(source: RelayUrlError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CommentError
impl RefUnwindSafe for CommentError
impl Send for CommentError
impl Sync for CommentError
impl Unpin for CommentError
impl UnsafeUnpin for CommentError
impl UnwindSafe for CommentError
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