pub struct ResolverOpts {Show 13 fields
pub ndots: usize,
pub timeout: Duration,
pub attempts: usize,
pub validate: bool,
pub ip_strategy: LookupIpStrategy,
pub cache_size: usize,
pub use_hosts_file: bool,
pub positive_min_ttl: Option<Duration>,
pub negative_min_ttl: Option<Duration>,
pub positive_max_ttl: Option<Duration>,
pub negative_max_ttl: Option<Duration>,
pub distrust_nx_responses: bool,
pub num_concurrent_reqs: usize,
/* private fields */
}Expand description
Configuration for the Resolver
Fields§
§ndots: usizeSets the number of dots that must appear (unless it’s a final dot representing the root)
that must appear before a query is assumed to include the TLD. The default is one, which
means that www would never be assumed to be a TLD, and would always be appended to either
the search
timeout: DurationSpecify the timeout for a request. Defaults to 5 seconds
attempts: usizeNumber of attempts before giving up. Defaults to 2
validate: boolUse DNSSec to validate the request
ip_strategy: LookupIpStrategyThe ip_strategy for the Resolver to use when lookup Ipv4 or Ipv6 addresses
cache_size: usizeCache size is in number of records (some records can be large)
use_hosts_file: boolCheck /ect/hosts file before dns requery (only works for unix like OS)
positive_min_ttl: Option<Duration>Optional minimum TTL for positive responses.
If this is set, any positive responses with a TTL lower than this value will have a TTL of
positive_min_ttl instead. Otherwise, this will default to 0 seconds.
negative_min_ttl: Option<Duration>Optional minimum TTL for negative (NXDOMAIN) responses.
If this is set, any positive responses with a TTL lower than this value will have a TTL of
negative_min_ttl instead. Otherwise, this will default to 0 seconds.
positive_max_ttl: Option<Duration>Optional maximum TTL for positive responses.
If this is set, any positive responses with a TTL higher than this value will have a TTL of
positive_max_ttl instead. Otherwise, this will default to MAX_TTL seconds.
negative_max_ttl: Option<Duration>Optional maximum TTL for negative (NXDOMAIN) responses.
If this is set, any positive responses with a TTL higher than this value will have a TTL of
negative_max_ttl instead. Otherwise, this will default to MAX_TTL seconds.
distrust_nx_responses: boolDefault is to distrust negative responses from upstream nameservers
Currently only SERVFAIL responses are continued on, this may be expanded to include NXDOMAIN or NoError/Empty responses
num_concurrent_reqs: usizeConcurrent requests where more than one Nameserver is registered, the default is 2
0 or 1 will configure this to execute all requests serially
Trait Implementations§
Source§impl Clone for ResolverOpts
impl Clone for ResolverOpts
Source§fn clone(&self) -> ResolverOpts
fn clone(&self) -> ResolverOpts
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolverOpts
impl Debug for ResolverOpts
Source§impl Default for ResolverOpts
impl Default for ResolverOpts
Source§fn default() -> ResolverOpts
fn default() -> ResolverOpts
Default values for the Resolver configuration.
This follows the resolv.conf defaults as defined in the Linux man pages
Source§impl PartialEq for ResolverOpts
impl PartialEq for ResolverOpts
impl Copy for ResolverOpts
impl Eq for ResolverOpts
impl StructuralPartialEq for ResolverOpts
Auto Trait Implementations§
impl Freeze for ResolverOpts
impl RefUnwindSafe for ResolverOpts
impl Send for ResolverOpts
impl Sync for ResolverOpts
impl Unpin for ResolverOpts
impl UnsafeUnpin for ResolverOpts
impl UnwindSafe for ResolverOpts
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
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>
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