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
}
}
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.
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.