Allow customizing the static hosts configuration
This allows custom runtimes to provide the hosts configuration in their own way, like using io_uring instead of the std::fs::File::open() to read the system hosts file.
This commit is contained in:

committed by
Benjamin Fry

parent
788e056349
commit
1845ccd088
@@ -436,6 +436,11 @@ impl<C: DnsHandle<Error = ResolveError>, P: ConnectionProvider<Conn = C>> AsyncR
|
||||
.await
|
||||
}
|
||||
|
||||
/// Customizes the static hosts used in this resolver.
|
||||
pub fn set_hosts(&mut self, hosts: Option<Hosts>) {
|
||||
self.hosts = hosts.map(|hosts| Arc::new(hosts));
|
||||
}
|
||||
|
||||
lookup_fn!(
|
||||
reverse_lookup,
|
||||
lookup::ReverseLookup,
|
||||
|
Reference in New Issue
Block a user