Add resolver.clear_cache() sync and async (#1611)

* Add resolver.clear_cache() sync and async

* Synchronise the docs
This commit is contained in:
Stefan Schindler
2022-01-05 00:00:02 +01:00
committed by GitHub
parent 6ef9b4ec4a
commit a30e694421
4 changed files with 21 additions and 0 deletions

View File

@@ -187,6 +187,11 @@ impl<R: RuntimeProvider> AsyncResolver<GenericConnection, GenericConnectionProvi
pub fn from_system_conf(runtime: R::Handle) -> Result<Self, ResolveError> {
Self::from_system_conf_with_provider(GenericConnectionProvider::<R>::new(runtime))
}
/// Flushes/Removes all entries from the cache
pub async fn clear_cache(&mut self) {
self.client_cache.clear_cache();
}
}
impl<C: DnsHandle<Error = ResolveError>, P: ConnectionProvider<Conn = C>> AsyncResolver<C, P> {