#[non_exhaustive]pub enum DiscoveryRejection {
UnsupportedVersion {
found: u8,
expected: u8,
},
FieldLength {
field: &'static str,
len: usize,
expected: usize,
},
UsernameMismatch {
claimed: String,
queried: String,
},
AddressNotDerived,
BadSignature,
ForeignAuthor,
}Expand description
Why a discovery record was rejected.
Separate from MlsError because every variant here is an ordinary
outcome of querying a public tag, not a fault: a resolver drops the record
and keeps going. Carrying them as errors would make junk at a public tag
look like a failure of the system reading it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedVersion
The version is not one this build understands.
FieldLength
A fixed-length field is the wrong size.
UsernameMismatch
The record claims a different name than the one queried.
A record is only meaningful at its own tag, so this also catches a record that was mis-tagged or copied to a foreign tag.
AddressNotDerived
derive_address(pubkey) is not the claimed address.
BadSignature
The signature does not verify under pubkey.
ForeignAuthor
The record was published under a different Nostr key than it names.
This is a re-authored copy: someone unsealed a genuine record and stood it back up under their own key. See the module docs.
Trait Implementations§
Source§impl Clone for DiscoveryRejection
impl Clone for DiscoveryRejection
Source§impl Debug for DiscoveryRejection
impl Debug for DiscoveryRejection
Source§impl Display for DiscoveryRejection
impl Display for DiscoveryRejection
impl Eq for DiscoveryRejection
Source§impl Error for DiscoveryRejection
impl Error for DiscoveryRejection
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for DiscoveryRejection
impl PartialEq for DiscoveryRejection
impl StructuralPartialEq for DiscoveryRejection
Auto Trait Implementations§
impl Freeze for DiscoveryRejection
impl RefUnwindSafe for DiscoveryRejection
impl Send for DiscoveryRejection
impl Sync for DiscoveryRejection
impl Unpin for DiscoveryRejection
impl UnsafeUnpin for DiscoveryRejection
impl UnwindSafe for DiscoveryRejection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more