[][src]Struct c_ares_resolver::BlockingResolver

pub struct BlockingResolver { /* fields omitted */ }

A blocking DNS resolver.

Implementations

impl BlockingResolver[src]

pub fn new() -> Result<Self, Error>[src]

Create a new BlockingResolver, using default Options.

pub fn with_options(options: Options) -> Result<BlockingResolver, Error>[src]

Create a new BlockingResolver, with the given Options.

pub fn set_servers(&self, servers: &[&str]) -> Result<&Self, Error>[src]

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.

pub fn set_local_ipv4(&self, ipv4: Ipv4Addr) -> &Self[src]

Set the local IPv4 address from which to make queries.

pub fn set_local_ipv6(&self, ipv6: &Ipv6Addr) -> &Self[src]

Set the local IPv6 address from which to make queries.

pub fn set_local_device(&self, device: &str) -> &Self[src]

Set the local device from which to make queries.

pub fn query_a(&self, name: &str) -> Result<AResults>[src]

Look up the A records associated with name.

pub fn search_a(&self, name: &str) -> Result<AResults>[src]

Search for the A records associated with name.

pub fn query_aaaa(&self, name: &str) -> Result<AAAAResults>[src]

Look up the AAAA records associated with name.

pub fn search_aaaa(&self, name: &str) -> Result<AAAAResults>[src]

Search for the AAAA records associated with name.

pub fn query_cname(&self, name: &str) -> Result<CNameResults>[src]

Look up the CNAME records associated with name.

pub fn search_cname(&self, name: &str) -> Result<CNameResults>[src]

Search for the CNAME records associated with name.

pub fn query_mx(&self, name: &str) -> Result<MXResults>[src]

Look up the MX records associated with name.

pub fn search_mx(&self, name: &str) -> Result<MXResults>[src]

Search for the MX records associated with name.

pub fn query_naptr(&self, name: &str) -> Result<NAPTRResults>[src]

Look up the NAPTR records associated with name.

pub fn search_naptr(&self, name: &str) -> Result<NAPTRResults>[src]

Search for the NAPTR records associated with name.

pub fn query_ns(&self, name: &str) -> Result<NSResults>[src]

Look up the NS records associated with name.

pub fn search_ns(&self, name: &str) -> Result<NSResults>[src]

Search for the NS records associated with name.

pub fn query_ptr(&self, name: &str) -> Result<PTRResults>[src]

Look up the PTR records associated with name.

pub fn search_ptr(&self, name: &str) -> Result<PTRResults>[src]

Search for the PTR records associated with name.

pub fn query_soa(&self, name: &str) -> Result<SOAResult>[src]

Look up the SOA records associated with name.

pub fn search_soa(&self, name: &str) -> Result<SOAResult>[src]

Search for the SOA records associated with name.

pub fn query_srv(&self, name: &str) -> Result<SRVResults>[src]

Look up the SRV records associated with name.

pub fn search_srv(&self, name: &str) -> Result<SRVResults>[src]

Search for the SRV records associated with name.

pub fn query_txt(&self, name: &str) -> Result<TXTResults>[src]

Look up the TXT records associated with name.

pub fn search_txt(&self, name: &str) -> Result<TXTResults>[src]

Search for the TXT records associated with name.

pub fn get_host_by_address(&self, address: &IpAddr) -> Result<HostResults>[src]

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.

pub fn get_host_by_name(
    &self,
    name: &str,
    family: AddressFamily
) -> Result<HostResults>
[src]

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.

pub fn get_name_info<F>(
    &self,
    address: &SocketAddr,
    flags: NIFlags
) -> Result<NameInfoResult>
[src]

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.

pub fn query(
    &self,
    name: &str,
    dns_class: u16,
    query_type: u16
) -> Result<Vec<u8>>
[src]

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.

pub fn search(
    &self,
    name: &str,
    dns_class: u16,
    query_type: u16
) -> Result<Vec<u8>>
[src]

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 search 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.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.