Struct domain::resolv::Resolver [] [src]

pub struct Resolver { /* fields omitted */ }

Access to a resolver.

This types collects all information in order to be able to start a DNS query on a resolver. You can create a new resolver by calling either the new() or from_conf() functions passing in a handle to a Tokio reactor core. Either function will spawn everything necessary for a resolver into that core. Existing resolver values can be cloned. Clones will refer to the same resolver.

In order to perform a query, you will have to call the start() method to create a future that will resolve into an intermediary value that will than allow calling a query() method on it and will also allow more complex operations as a complex future.

Alternatively, you can use the run() associated function to synchronously perfrom a series of queries.

Methods

impl Resolver
[src]

Creates a new resolver using the system’s default configuration.

All the components of the resolver will be spawned into the reactor referenced by reactor.

Creates a new resolver using the given configuration.

All the components of the resolver will be spawned into the reactor referenced by reactor.

Returns a reference to the configuration of this resolver.

Returns a reference to the configuration options of this resolver.

Starts a resolver future atop this resolver.

The method returns a future that will resolve into a ResolverTask value that can be used to start queries atop this resolver.

Since the future will never error, it is generic over the error type.

impl Resolver
[src]

Synchronously perform a DNS operation atop a standard resolver.

This associated functions removes almost all boiler plate for the case that you want to perform some DNS operation on a resolver using the system’s configuration and wait for the result.

The only argument is a closure taking a [ResolverTask] for creating queries and returning a future. Whatever that future resolves to will be returned.

Spawn a query.

This method is a shortcut for self.start().and_then(f).boxed(). Because of the boxed() bit, it requires lots of things to be Send + 'static and because of that isn’t necessarily better than the longer way.

I am also not sure if spawn is the right name. Probably not since it actually returns the future.

Trait Implementations

impl Clone for Resolver
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Resolver
[src]

Formats the value using the given formatter.