Type Alias async_std_resolver::AsyncStdResolver
source · pub type AsyncStdResolver = AsyncResolver<AsyncStdConnectionProvider>;
Expand description
An AsyncResolver used with async_std
Aliased Type§
struct AsyncStdResolver { /* private fields */ }
Implementations
source§impl<R> AsyncResolver<R>where
R: ConnectionProvider,
impl<R> AsyncResolver<R>where
R: ConnectionProvider,
sourcepub fn new(
config: ResolverConfig,
options: ResolverOpts,
provider: R
) -> AsyncResolver<R>
pub fn new( config: ResolverConfig, options: ResolverOpts, provider: R ) -> AsyncResolver<R>
Construct a new generic AsyncResolver
with the provided configuration.
see [TokioAsyncResolver::tokio(..)] instead.
Arguments
config
- configuration, name_servers, etc. for the Resolveroptions
- 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.
sourcepub fn from_system_conf(runtime: R) -> Result<AsyncResolver<R>, ResolveError>
pub fn from_system_conf(runtime: R) -> Result<AsyncResolver<R>, ResolveError>
Constructs a new Resolver with the system configuration.
see [TokioAsyncResolver::tokio_from_system_conf(..)] instead.
This will use /etc/resolv.conf
on Unix OSes and the registry on Windows.
sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Flushes/Removes all entries from the cache
source§impl<P> AsyncResolver<P>where
P: ConnectionProvider,
impl<P> AsyncResolver<P>where
P: ConnectionProvider,
sourcepub fn new_with_conn(
config: ResolverConfig,
options: ResolverOpts,
conn_provider: P
) -> AsyncResolver<P>
pub fn new_with_conn( config: ResolverConfig, options: ResolverOpts, conn_provider: P ) -> AsyncResolver<P>
Construct a new AsyncResolver
with the provided configuration.
Arguments
config
- configuration, name_servers, etc. for the Resolveroptions
- 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.
sourcepub fn from_system_conf_with_provider(
conn_provider: P
) -> Result<AsyncResolver<P>, ResolveError>
pub fn from_system_conf_with_provider( conn_provider: P ) -> Result<AsyncResolver<P>, ResolveError>
Constructs a new Resolver with the system configuration.
This will use /etc/resolv.conf
on Unix OSes and the registry on Windows.
sourcepub async fn lookup<N>(
&self,
name: N,
record_type: RecordType
) -> Result<Lookup, ResolveError>where
N: IntoName,
pub async fn lookup<N>(
&self,
name: N,
record_type: RecordType
) -> Result<Lookup, ResolveError>where
N: IntoName,
Generic lookup for any RecordType
WARNING this interface may change in the future, see if one of the specializations would be better.
Arguments
name
- name of the record to lookup, if name is not a valid domain name, an error will be returnedrecord_type
- type of record to lookup, all RecordData responses will be filtered to this type
Returns
sourcepub async fn lookup_ip<N>(&self, host: N) -> Result<LookupIp, ResolveError>where
N: IntoName + TryParseIp,
pub async fn lookup_ip<N>(&self, host: N) -> Result<LookupIp, ResolveError>where
N: IntoName + TryParseIp,
Performs a dual-stack DNS lookup for the IP for the given hostname.
See the configuration and options parameters for controlling the way in which A(Ipv4) and AAAA(Ipv6) lookups will be performed. For the least expensive query a fully-qualified-domain-name, FQDN, which ends in a final .
, e.g. www.example.com.
, will only issue one query. Anything else will always incur the cost of querying the ResolverConfig::domain
and ResolverConfig::search
.
Arguments
host
- string hostname, if this is an invalid hostname, an error will be returned.
sourcepub fn set_hosts(&mut self, hosts: Option<Hosts>)
pub fn set_hosts(&mut self, hosts: Option<Hosts>)
Customizes the static hosts used in this resolver.
sourcepub async fn reverse_lookup(
&self,
query: IpAddr
) -> Result<ReverseLookup, ResolveError>
pub async fn reverse_lookup( &self, query: IpAddr ) -> Result<ReverseLookup, ResolveError>
Performs a lookup for the associated type.
Arguments
query
- a type which can be converted toName
viaFrom
.
sourcepub async fn ipv4_lookup<N>(&self, query: N) -> Result<Ipv4Lookup, ResolveError>where
N: IntoName,
pub async fn ipv4_lookup<N>(&self, query: N) -> Result<Ipv4Lookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn ipv6_lookup<N>(&self, query: N) -> Result<Ipv6Lookup, ResolveError>where
N: IntoName,
pub async fn ipv6_lookup<N>(&self, query: N) -> Result<Ipv6Lookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn mx_lookup<N>(&self, query: N) -> Result<MxLookup, ResolveError>where
N: IntoName,
pub async fn mx_lookup<N>(&self, query: N) -> Result<MxLookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn ns_lookup<N>(&self, query: N) -> Result<NsLookup, ResolveError>where
N: IntoName,
pub async fn ns_lookup<N>(&self, query: N) -> Result<NsLookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn soa_lookup<N>(&self, query: N) -> Result<SoaLookup, ResolveError>where
N: IntoName,
pub async fn soa_lookup<N>(&self, query: N) -> Result<SoaLookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn srv_lookup<N>(&self, query: N) -> Result<SrvLookup, ResolveError>where
N: IntoName,
pub async fn srv_lookup<N>(&self, query: N) -> Result<SrvLookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn tlsa_lookup<N>(&self, query: N) -> Result<TlsaLookup, ResolveError>where
N: IntoName,
pub async fn tlsa_lookup<N>(&self, query: N) -> Result<TlsaLookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
sourcepub async fn txt_lookup<N>(&self, query: N) -> Result<TxtLookup, ResolveError>where
N: IntoName,
pub async fn txt_lookup<N>(&self, query: N) -> Result<TxtLookup, ResolveError>where
N: IntoName,
Performs a lookup for the associated type.
hint queries that end with a ‘.’ are fully qualified names and are cheaper lookups
Arguments
query
- a string which parses to a domain name, failure to parse will return an error
Trait Implementations
source§impl<P> Debug for AsyncResolver<P>where
P: ConnectionProvider,
impl<P> Debug for AsyncResolver<P>where
P: ConnectionProvider,
source§impl<P> Clone for AsyncResolver<P>where
P: Clone + ConnectionProvider,
impl<P> Clone for AsyncResolver<P>where
P: Clone + ConnectionProvider,
source§fn clone(&self) -> AsyncResolver<P>
fn clone(&self) -> AsyncResolver<P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more