Struct c_ares::Channel
[−]
[src]
pub struct Channel { // some fields omitted }
A channel for name service lookups.
Methods
impl Channel
[src]
fn new<F>(callback: F, options: Options) -> Result<Channel, AresError> where F: FnMut(RawFd, bool, bool) + 'static
Create a new channel for name service lookups, providing a callback for socket state changes.
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 to write events.
fn process_fd(&mut self, read_fd: RawFd, write_fd: RawFd)
Handle input, output, and timeout events associated with the specified file descriptors (sockets).
Providing a value for read_fd
indicates that the identified socket
is readable; likewise providing a value for write_fd
indicates that
the identified socket is writable. Use INVALID_FD
for "no action".
fn set_servers(&mut self, servers: &[&str]) -> Result<(), AresError>
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 query_a<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<AResults, AresError>) + 'static
Look up the A records associated with name
.
On completion, handler
is called with the result.
fn query_aaaa<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<AAAAResults, AresError>) + 'static
Look up the AAAA records associated with name
.
On completion, handler
is called with the result.
fn query_cname<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<CNameResult, AresError>) + 'static
Look up the CNAME record associated with name
.
On completion, handler
is called with the result.
fn query_mx<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<MXResults, AresError>) + 'static
Look up the MX records associated with name
.
On completion, handler
is called with the result.
fn query_naptr<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<NAPTRResults, AresError>) + 'static
Look up the NAPTR records associated with name
.
On completion, handler
is called with the result.
fn query_ns<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<NSResults, AresError>) + 'static
Look up the NS records associated with name
.
On completion, handler
is called with the result.
fn query_ptr<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<PTRResults, AresError>) + 'static
Look up the PTR records associated with name
.
On completion, handler
is called with the result.
fn query_srv<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<SRVResults, AresError>) + 'static
Look up the SRV records associated with name
.
On completion, handler
is called with the result.
fn query_txt<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<TXTResults, AresError>) + 'static
Look up the TXT records associated with name
.
On completion, handler
is called with the result.
fn query_soa<F>(&mut self, name: &str, handler: F) where F: FnOnce(Result<SOAResult, AresError>) + 'static
Look up the SOA records associated with name
.
On completion, handler
is called with the result.