#[non_exhaustive]pub enum ResolveError {
Timeout(Duration),
Lookup(Error),
PrivateAddress {
host: String,
addr: IpAddr,
},
}Expand description
Error returned by resolve_and_validate when a hostname cannot be safely resolved.
Callers map this into their own error type — it carries enough context (the timeout, the underlying I/O error, or the offending address) to build a user-facing message.
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.
Timeout(Duration)
DNS resolution did not complete within the lookup timeout.
Lookup(Error)
The DNS lookup itself failed (NXDOMAIN, network error, etc.).
PrivateAddress
A resolved address falls in a private/loopback/link-local range.
Trait Implementations§
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · 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()
Auto Trait Implementations§
impl !RefUnwindSafe for ResolveError
impl !UnwindSafe for ResolveError
impl Freeze for ResolveError
impl Send for ResolveError
impl Sync for ResolveError
impl Unpin for ResolveError
impl UnsafeUnpin for ResolveError
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