pub struct Options { /* private fields */ }
Expand description

Used to configure the behaviour of the resolver.

Implementations§

source§

impl Options

source

pub fn new() -> Self

Returns a fresh Options, on which no values are set.

source

pub fn set_flags(&mut self, flags: Flags) -> &mut Self

Set flags controlling the behaviour of the resolver.

source

pub fn set_timeout(&mut self, ms: u32) -> &mut Self

Set the number of milliseconds each name server is given to respond to a query on the first try. (After the first try, the timeout algorithm becomes more complicated, but scales linearly with the value of timeout). The default is 5000ms.

source

pub fn set_tries(&mut self, tries: u32) -> &mut Self

Set the number of tries the resolver will try contacting each name server before giving up. The default is four tries.

source

pub fn set_ndots(&mut self, ndots: u32) -> &mut Self

Set the number of dots which must be present in a domain name for it to be queried for “as is” prior to querying for it with the default domain extensions appended. The default value is 1 unless set otherwise by resolv.conf or the RES_OPTIONS environment variable.

source

pub fn set_udp_port(&mut self, udp_port: u16) -> &mut Self

Set the UDP port to use for queries. The default value is 53, the standard name service port.

source

pub fn set_tcp_port(&mut self, tcp_port: u16) -> &mut Self

Set the TCP port to use for queries. The default value is 53, the standard name service port.

source

pub fn set_domains(&mut self, domains: &[&str]) -> &mut Self

Set the domains to search, instead of the domains specified in resolv.conf or the domain derived from the kernel hostname variable.

source

pub fn set_lookups(&mut self, lookups: &str) -> &mut Self

Set the lookups to perform for host queries. lookups should be set to a string of the characters “b” or “f”, where “b” indicates a DNS lookup and “f” indicates a lookup in the hosts file.

source

pub fn set_sock_send_buffer_size(&mut self, size: u32) -> &mut Self

Set the socket send buffer size.

source

pub fn set_sock_receive_buffer_size(&mut self, size: u32) -> &mut Self

Set the socket receive buffer size.

source

pub fn set_rotate(&mut self) -> &mut Self

Configure round robin selection of nameservers.

source

pub fn set_no_rotate(&mut self) -> &mut Self

Prevent round robin selection of nameservers.

source

pub fn set_ednspsz(&mut self, size: u32) -> &mut Self

Set the EDNS packet size.

source

pub fn set_resolvconf_path(&mut self, resolvconf_path: &str) -> &mut Self

Set the path to use for reading the resolv.conf file. The resolvconf_path should be set to a path string, and will be honoured on *nix like systems. The default is /etc/resolv.conf.

Trait Implementations§

source§

impl Default for Options

source§

fn default() -> Options

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more