#[non_exhaustive]pub enum AuthError {
UnexpectedKind(u16),
MissingRelayTag,
MissingChallengeTag,
InvalidRelay(RelayUrlError),
RelayMismatch {
expected: String,
got: String,
},
ChallengeMismatch,
TooOld {
created_at: u64,
now: u64,
max_age: u64,
},
TooFuture {
created_at: u64,
now: u64,
max_age: u64,
},
}Expand description
Errors raised when verifying a NIP-42 auth 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 22242.
MissingRelayTag
The relay tag was missing or empty.
MissingChallengeTag
The challenge tag was missing or empty.
InvalidRelay(RelayUrlError)
The relay tag value did not parse as a RelayUrl.
RelayMismatch
The relay tag did not match the expected relay URL.
Fields
ChallengeMismatch
The challenge tag did not match the expected challenge string.
TooOld
created_at is more than max_age seconds old.
Fields
TooFuture
created_at is more than max_age seconds in the future.
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
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<RelayUrlError> for AuthError
impl From<RelayUrlError> for AuthError
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 AuthError
impl RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnsafeUnpin for AuthError
impl UnwindSafe for AuthError
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