Struct c_ares::Options
[−]
[src]
pub struct Options { /* fields omitted */ }
Used to configure the behaviour of the name resolver.
Methods
impl Options
[src]
fn new() -> Self
[src]
Returns a fresh Options
, on which no values are set.
fn set_flags(&mut self, flags: Flags) -> &mut Self
[src]
Set flags controlling the behaviour of the resolver. The available flags are documented here.
fn set_timeout(&mut self, ms: u32) -> &mut Self
[src]
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.
fn set_tries(&mut self, tries: u32) -> &mut Self
[src]
Set the number of tries the resolver will try contacting each name server before giving up. The default is four tries.
fn set_ndots(&mut self, ndots: u32) -> &mut Self
[src]
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.
fn set_udp_port(&mut self, udp_port: u16) -> &mut Self
[src]
Set the UDP port to use for queries. The default value is 53, the standard name service port.
fn set_tcp_port(&mut self, tcp_port: u16) -> &mut Self
[src]
Set the TCP port to use for queries. The default value is 53, the standard name service port.
fn set_domains(&mut self, domains: &[&str]) -> &mut Self
[src]
Set the domains to search, instead of the domains specified in resolv.conf or the domain derived from the kernel hostname variable.
fn set_lookups(&mut self, lookups: &str) -> &mut Self
[src]
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.
fn set_socket_state_callback<F>(&mut self, callback: F) -> &mut Self where
F: FnMut(Socket, bool, bool) + Send + 'static,
[src]
F: FnMut(Socket, bool, bool) + Send + 'static,
Set the callback function to be invoked when a socket changes state.
callback(socket, read, write)
will be called when a socket changes
state:
-
read
is set to true if the socket should listen for read events -
write
is set to true if the socket should listen for write events.
fn set_sock_send_buffer_size(&mut self, size: u32) -> &mut Self
[src]
Set the socket send buffer size.
fn set_sock_receive_buffer_size(&mut self, size: u32) -> &mut Self
[src]
Set the socket receive buffer size.
fn set_rotate(&mut self) -> &mut Self
[src]
Configure round robin selection of nameservers.
fn set_no_rotate(&mut self) -> &mut Self
[src]
Prevent round robin selection of nameservers.
fn set_ednspsz(&mut self, size: u32) -> &mut Self
[src]
Set the EDNS packet size.