Struct trust_dns_resolver::config::ResolverOpts[][src]

pub struct ResolverOpts {
Show fields pub ndots: usize, pub timeout: Duration, pub attempts: usize, pub rotate: bool, pub check_names: bool, pub edns0: bool, 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 num_concurrent_reqs: usize, pub preserve_intermediates: bool,
}
Expand description

Configuration for the Resolver

Fields

ndots: usize
Expand description

Sets 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: Duration
Expand description

Specify the timeout for a request. Defaults to 5 seconds

attempts: usize
Expand description

Number of retries after lookup failure before giving up. Defaults to 2

rotate: bool
Expand description

Rotate through the resource records in the response (if there is more than one for a given name)

check_names: bool
Expand description

Validate the names in the response, not implemented don’t really see the point unless you need to support badly configured DNS

edns0: bool
Expand description

Enable edns, for larger records

validate: bool
Expand description

Use DNSSec to validate the request

ip_strategy: LookupIpStrategy
Expand description

The ip_strategy for the Resolver to use when lookup Ipv4 or Ipv6 addresses

cache_size: usize
Expand description

Cache size is in number of records (some records can be large)

use_hosts_file: bool
Expand description

Check /ect/hosts file before dns requery (only works for unix like OS)

positive_min_ttl: Option<Duration>
Expand description

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>
Expand description

Optional minimum TTL for negative (NXDOMAIN) responses.

If this is set, any negative 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>
Expand description

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>
Expand description

Optional maximum TTL for negative (NXDOMAIN) responses.

If this is set, any negative 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.

num_concurrent_reqs: usize
Expand description

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; 0 or 1 will execute requests serially.

preserve_intermediates: bool
Expand description

Preserve all intermediate records in the lookup response, suchas CNAME records

Trait Implementations

impl Clone for ResolverOpts[src]

fn clone(&self) -> ResolverOpts[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ResolverOpts[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for ResolverOpts[src]

fn default() -> Self[src]

Default values for the Resolver configuration.

This follows the resolv.conf defaults as defined in the Linux man pages

impl PartialEq<ResolverOpts> for ResolverOpts[src]

fn eq(&self, other: &ResolverOpts) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &ResolverOpts) -> bool[src]

This method tests for !=.

impl Copy for ResolverOpts[src]

impl Eq for ResolverOpts[src]

impl StructuralEq for ResolverOpts[src]

impl StructuralPartialEq for ResolverOpts[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V