Add getters for resolver config and options (#2093)

This commit is contained in:
Liam Gray 2023-11-20 12:37:06 +00:00 committed by GitHub
parent 2b1fe9e007
commit b0b6957b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -175,6 +175,16 @@ impl<R: ConnectionProvider> AsyncResolver<R> {
pub fn clear_cache(&self) {
self.client_cache.clear_cache();
}
/// Read the config for this resolver.
pub fn config(&self) -> &ResolverConfig {
&self.config
}
/// Read the options for this resolver.
pub fn options(&self) -> &ResolverOpts {
&self.options
}
}
impl<P: ConnectionProvider> AsyncResolver<P> {

View File

@ -120,6 +120,16 @@ impl Resolver {
self.async_resolver.clear_cache();
}
/// Read the config for this resolver.
pub fn config(&self) -> &ResolverConfig {
self.async_resolver.config()
}
/// Read the options for this resolver.
pub fn options(&self) -> &ResolverOpts {
self.async_resolver.options()
}
/// Generic lookup for any RecordType
///
/// *WARNING* This interface may change in the future, please use [`Self::lookup_ip`] or another variant for more stable interfaces.