pub struct Resolver {
pub ns: Vec<SocketAddr>,
pub tcp: bool,
pub timeout: Option<Duration>,
}
Expand description
An asynchronous DNS resolver.
Fields§
§ns: Vec<SocketAddr>
§tcp: bool
§timeout: Option<Duration>
Implementations§
Source§impl Resolver
impl Resolver
pub fn new(ns: Vec<SocketAddr>) -> Resolver
Sourcepub fn cloudflare() -> Resolver
pub fn cloudflare() -> Resolver
Creates a new resolver using the CloudFlare Authoritative DNS service.
Sourcepub fn google() -> Resolver
pub fn google() -> Resolver
Creates a new resolver using the Google Public DNS service.
Sourcepub fn from_system() -> Result<Resolver>
pub fn from_system() -> Result<Resolver>
Creates a new resolver from /etc/resolv.conf
.
Sourcepub fn from_system_v4() -> Result<Resolver>
pub fn from_system_v4() -> Result<Resolver>
Creates a new resolver from /etc/resolv.conf
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resolver
impl<'de> Deserialize<'de> for Resolver
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DnsResolver for Resolver
impl DnsResolver for Resolver
impl StructuralPartialEq for Resolver
Auto Trait Implementations§
impl Freeze for Resolver
impl RefUnwindSafe for Resolver
impl Send for Resolver
impl Sync for Resolver
impl Unpin for Resolver
impl UnwindSafe for Resolver
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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