#[non_exhaustive]pub enum DnsError {
Timeout {
meta: Meta,
},
NoResponse {
meta: Meta,
},
ResolveBoth {
ipv4: Box<DnsError>,
ipv6: Box<DnsError>,
meta: Meta,
},
MissingHost {
meta: Meta,
},
Resolve {
source: AnyError,
meta: Meta,
},
InvalidResponse {
meta: Meta,
},
NxDomain {
meta: Meta,
},
}wasm_browser only.Expand description
Potential errors related to DNS operations.
Distinct, matchable causes have their own variant, such as Self::NxDomain
(a nameserver reported the name does not exist, unlike a transient transport
or timeout failure). Any other cause is reported as Self::Resolve, whose
[AnyError] source carries the underlying error.
The resolver backing this crate is an implementation detail and its error
types are not part of the public API. If you depend on n0-dns-resolver
directly and need the exact reason, downcast a Self::Resolve source:
if let DnsError::Resolve { source, .. } = &err {
if let Some(inner) = source.downcast_ref::<n0_dns_resolver::Error>() {
// match on `inner` for the specific failure
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout
Fields
meta: MetaCaptured call-site metadata
NoResponse
Fields
meta: MetaCaptured call-site metadata
ResolveBoth
MissingHost
Fields
meta: MetaCaptured call-site metadata
Resolve
A resolution failure not covered by another variant.
Downcast the source (see the type-level docs) to recover the specific cause.
InvalidResponse
Fields
meta: MetaCaptured call-site metadata
NxDomain
The domain name does not exist (NXDOMAIN).
A nameserver authoritatively reported that the name does not exist, as opposed to a transient transport or timeout failure, so retrying will not make the lookup succeed.
Fields
meta: MetaCaptured call-site metadata
Trait Implementations§
Source§impl Error for DnsError
impl Error for DnsError
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
Source§impl From<DnsError> for LookupError
impl From<DnsError> for LookupError
Source§fn from(source: DnsError) -> LookupError
fn from(source: DnsError) -> LookupError
Source§impl StackError for DnsError
impl StackError for DnsError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<DnsError>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<DnsError>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for DnsError
impl !RefUnwindSafe for DnsError
impl Send for DnsError
impl Sync for DnsError
impl Unpin for DnsError
impl !UnwindSafe for DnsError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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