pub trait Resolver: Send + Sync {
// Required methods
fn naptr(&self, domain: &str) -> Vec<Naptr>;
fn srv(&self, name: &str) -> Vec<Srv>;
fn addresses(&self, host: &str) -> Vec<IpAddr>;
}Expand description
What a resolver must be able to answer.
A trait rather than a concrete DNS client so that the selection logic — which is where the bugs live — is testable without a network.