#[non_exhaustive]pub enum DraftError {
WrongKind(Kind),
MissingIdentifier,
MissingDraftKind,
InvalidDraftKind(String),
InvalidTimestamp(TimestampError),
Encryption(Nip44Error),
Json(Error),
InvalidRelayUrl(RelayUrlError),
}Available on crate feature
nip44 only.Expand description
Errors raised by NIP-37 helpers.
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.
WrongKind(Kind)
Event kind is not 31234 / 10013.
MissingIdentifier
d tag missing on a draft wrap.
MissingDraftKind
k tag missing on a draft wrap.
InvalidDraftKind(String)
k tag value is not a valid kind integer.
InvalidTimestamp(TimestampError)
Wrapped timestamp parser error.
Encryption(Nip44Error)
Wrapped NIP-44 error.
Json(Error)
JSON serialisation error.
InvalidRelayUrl(RelayUrlError)
Wrapped relay-URL parser error (private list).
Trait Implementations§
Source§impl Debug for DraftError
impl Debug for DraftError
Source§impl Display for DraftError
impl Display for DraftError
Source§impl Error for DraftError
impl Error for DraftError
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<Error> for DraftError
impl From<Error> for DraftError
Source§impl From<Nip44Error> for DraftError
impl From<Nip44Error> for DraftError
Source§fn from(source: Nip44Error) -> Self
fn from(source: Nip44Error) -> Self
Converts to this type from the input type.
Source§impl From<RelayUrlError> for DraftError
impl From<RelayUrlError> for DraftError
Source§fn from(source: RelayUrlError) -> Self
fn from(source: RelayUrlError) -> Self
Converts to this type from the input type.
Source§impl From<TimestampError> for DraftError
impl From<TimestampError> for DraftError
Source§fn from(source: TimestampError) -> Self
fn from(source: TimestampError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for DraftError
impl !UnwindSafe for DraftError
impl Freeze for DraftError
impl Send for DraftError
impl Sync for DraftError
impl Unpin for DraftError
impl UnsafeUnpin for DraftError
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