Skip to main content

Resolver

Trait Resolver 

Source
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.

Required Methods§

Source

fn naptr(&self, domain: &str) -> Vec<Naptr>

NAPTR records for a domain.

Source

fn srv(&self, name: &str) -> Vec<Srv>

SRV records for a name.

Source

fn addresses(&self, host: &str) -> Vec<IpAddr>

Addresses for a host.

Implementors§