Type Definition trust_dns_resolver::ResolverFuture

source ·
pub type ResolverFuture = TokioAsyncResolver;
👎Deprecated: use [trust_dns_resolver::AsyncResolver] instead
Available on crate feature tokio-runtime only.
Expand description

This is an alias for AsyncResolver, which replaced the type previously called ResolverFuture.

Note

For users of ResolverFuture, the return type for ResolverFuture::new has changed since version 0.9 of trust-dns-resolver. It now returns a tuple of an AsyncResolver and a background future, which must be spawned on a reactor before any lookup futures will run.

See the AsyncResolver documentation for more information on how to use the background future.

Implementations§

source§

impl TokioAsyncResolver

source

pub fn tokio(config: ResolverConfig, options: ResolverOpts) -> Self

Construct a new Tokio based AsyncResolver with the provided configuration.

Arguments
  • config - configuration, name_servers, etc. for the Resolver
  • options - basic lookup options for the resolver
Returns

A tuple containing the new AsyncResolver and a future that drives the background task that runs resolutions for the AsyncResolver. See the documentation for AsyncResolver for more information on how to use the background future.

source

pub fn tokio_from_system_conf() -> Result<Self, ResolveError>

Available on crate feature system-config and (Unix or Windows) only.

Constructs a new Tokio based Resolver with the system configuration.

This will use /etc/resolv.conf on Unix OSes and the registry on Windows.