Struct c_ares_resolver::FutureResolver
[−]
[src]
pub struct FutureResolver { /* fields omitted */ }
An asynchronous DNS resolver, which returns results as
futures::Future
s.
Methods
impl FutureResolver
[src]
fn new() -> Result<FutureResolver, Error>
Create a new FutureResolver
, using default Options
.
fn with_options(options: Options) -> Result<FutureResolver, Error>
Create a new FutureResolver
, with the given Options
.
fn set_servers(&mut self, servers: &[&str]) -> Result<&mut Self, Error>
Set the list of servers to contact, instead of the servers specified in resolv.conf or the local named.
String format is host[:port]
. IPv6 addresses with ports require
square brackets eg [2001:4860:4860::8888]:53
.
fn set_local_ipv4(&mut self, ipv4: &Ipv4Addr) -> &mut Self
Set the local IPv4 address from which to make queries.
fn set_local_ipv6(&mut self, ipv6: &Ipv6Addr) -> &mut Self
Set the local IPv6 address from which to make queries.
fn set_local_device(&mut self, device: &str) -> &mut Self
Set the local device from which to make queries.
fn query_a(&self, name: &str) -> CAresFuture<AResults>
Look up the A records associated with name
.
fn search_a(&self, name: &str) -> CAresFuture<AResults>
Search for the A records associated with name
.
fn query_aaaa(&self, name: &str) -> CAresFuture<AAAAResults>
Look up the AAAA records associated with name
.
fn search_aaaa(&self, name: &str) -> CAresFuture<AAAAResults>
Search for the AAAA records associated with name
.
fn query_cname(&self, name: &str) -> CAresFuture<CNameResults>
Look up the CNAME records associated with name
.
fn search_cname(&self, name: &str) -> CAresFuture<CNameResults>
Search for the CNAME records associated with name
.
fn query_mx(&self, name: &str) -> CAresFuture<MXResults>
Look up the MX records associated with name
.
fn search_mx(&self, name: &str) -> CAresFuture<MXResults>
Search for the MX records associated with name
.
fn query_naptr(&self, name: &str) -> CAresFuture<NAPTRResults>
Look up the NAPTR records associated with name
.
fn search_naptr(&self, name: &str) -> CAresFuture<NAPTRResults>
Search for the NAPTR records associated with name
.
fn query_ns(&self, name: &str) -> CAresFuture<NSResults>
Look up the NS records associated with name
.
fn search_ns(&self, name: &str) -> CAresFuture<NSResults>
Search for the NS records associated with name
.
fn query_ptr(&self, name: &str) -> CAresFuture<PTRResults>
Look up the PTR records associated with name
.
fn search_ptr(&self, name: &str) -> CAresFuture<PTRResults>
Search for the PTR records associated with name
.
fn query_soa(&self, name: &str) -> CAresFuture<SOAResult>
Look up the SOA records associated with name
.
fn search_soa(&self, name: &str) -> CAresFuture<SOAResult>
Search for the SOA records associated with name
.
fn query_srv(&self, name: &str) -> CAresFuture<SRVResults>
Look up the SRV records associated with name
.
fn search_srv(&self, name: &str) -> CAresFuture<SRVResults>
Search for the SRV records associated with name
.
fn query_txt(&self, name: &str) -> CAresFuture<TXTResults>
Look up the TXT records associated with name
.
fn search_txt(&self, name: &str) -> CAresFuture<TXTResults>
Search for the TXT records associated with name
.
fn get_host_by_address(&self, address: &IpAddr) -> CAresFuture<HostResults>
Perform a host query by address.
This method is one of the very few places where this library performs
strictly more allocation than the underlying c-ares
code. If this is
a problem for you, you should prefer to use the analogous method on the
Resolver
.
fn get_host_by_name(
&self,
name: &str,
family: AddressFamily
) -> CAresFuture<HostResults>
&self,
name: &str,
family: AddressFamily
) -> CAresFuture<HostResults>
Perform a host query by name.
This method is one of the very few places where this library performs
strictly more allocation than the underlying c-ares
code. If this is
a problem for you, you should prefer to use the analogous method on the
Resolver
.
fn get_name_info<F>(
&self,
address: &SocketAddr,
flags: NIFlags
) -> CAresFuture<NameInfoResult>
&self,
address: &SocketAddr,
flags: NIFlags
) -> CAresFuture<NameInfoResult>
Address-to-nodename translation in protocol-independent manner.
This method is one of the very few places where this library performs
strictly more allocation than the underlying c-ares
code. If this is
a problem for you, you should prefer to use the analogous method on the
Resolver
.
fn query(
&self,
name: &str,
dns_class: u16,
query_type: u16
) -> CAresFuture<Vec<u8>>
&self,
name: &str,
dns_class: u16,
query_type: u16
) -> CAresFuture<Vec<u8>>
Initiate a single-question DNS query for name
. The class and type of
the query are per the provided parameters, taking values as defined in
arpa/nameser.h
.
This method is one of the very few places where this library performs
strictly more allocation than the underlying c-ares
code. If this is
a problem for you, you should prefer to use the analogous method on the
Resolver
.
This method is provided so that users can query DNS types for which
c-ares
does not provide a parser; or in case a third-party parser is
preferred. Usually, if a suitable query_xxx()
is available, that
should be used.
fn search(
&self,
name: &str,
dns_class: u16,
query_type: u16
) -> CAresFuture<Vec<u8>>
&self,
name: &str,
dns_class: u16,
query_type: u16
) -> CAresFuture<Vec<u8>>
Initiate a series of single-question DNS queries for name
. The
class and type of the query are per the provided parameters, taking
values as defined in arpa/nameser.h
.
This method is one of the very few places where this library performs
strictly more allocation than the underlying c-ares
code. If this is
a problem for you, you should prefer to use the analogous method on the
Resolver
.
This method is provided so that users can query DNS types for which
c-ares
does not provide a parser; or in case a third-party parser is
preferred. Usually, if a suitable search_xxx()
is available, that
should be used.
fn cancel(&mut self)
Cancel all requests made on this FutureResolver
.