pub struct HickoryDnsResolverBuilder { /* private fields */ }
Available on crate feature
hickory-dns
and non-target_family="wasm"
only.Expand description
Builder for HickoryDnsResolver
Implementations§
Source§impl HickoryDnsResolverBuilder
impl HickoryDnsResolverBuilder
Sourcepub fn nameservers(self, ips: &[IpAddr], port: u16) -> Self
pub fn nameservers(self, ips: &[IpAddr], port: u16) -> Self
Configure upstream nameservers and the port to use for resolution. Defaults to the system configuration.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Specify the timeout for a request. Defaults to 5 seconds.
Sourcepub fn attempts(self, attempts: usize) -> Self
pub fn attempts(self, attempts: usize) -> Self
Number of retries after lookup failure before giving up. Defaults to 2.
Sourcepub fn cache_size(self, cache_size: usize) -> Self
pub fn cache_size(self, cache_size: usize) -> Self
Cache size is in number of records (some records can be large). Defaults to 32.
Sourcepub fn num_concurrent_reqs(self, num_concurrent_reqs: usize) -> Self
pub fn num_concurrent_reqs(self, num_concurrent_reqs: usize) -> Self
Number of concurrent requests per query.
Where more than one nameserver is configured, this configures the resolver to send queries to a number of servers in parallel. Defaults to 2. Setting to 0 or 1 will execute requests serially.
Sourcepub fn build(self) -> HickoryDnsResolver
pub fn build(self) -> HickoryDnsResolver
Build a HickoryDnsResolver
Auto Trait Implementations§
impl Freeze for HickoryDnsResolverBuilder
impl RefUnwindSafe for HickoryDnsResolverBuilder
impl Send for HickoryDnsResolverBuilder
impl Sync for HickoryDnsResolverBuilder
impl Unpin for HickoryDnsResolverBuilder
impl UnwindSafe for HickoryDnsResolverBuilder
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
§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>
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 moreCreates a shared type from an unshared type.