pub struct StubResolver { /* private fields */ }
Available on crate feature resolv only.
Expand description

A DNS stub resolver.

This type collects all information making it possible to start DNS queries. You can create a new resolver using the system’s configuration using the new() associate function or using your own configuration with from_conf().

Stub resolver values can be cloned relatively cheaply as they keep all information behind an arc.

If you want to run a single query or lookup on a resolver synchronously, you can do so simply by using the run() or run_with_conf() associated functions.

Implementations

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

Creates a new resolver using the given configuraiton.

Available on crate feature resolv-sync only.

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, either a query or lookup, on a resolver using the system’s configuration and wait for the result.

The only argument is a closure taking a reference to a StubResolver and returning a future. Whatever that future resolves to will be returned.

Available on crate feature resolv-sync only.

Synchronously perform a DNS operation atop a configured resolver.

This is like run() but also takes a resolver configuration for tailor-making your own resolver.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The answer returned by a query. Read more

The future resolving into an answer.

Returns a future answering a question. Read more

Returns an iterator over the search suffixes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.