pub trait Resolver: Send + Sync {
// Required methods
fn reverse<'life0, 'async_trait>(
&'life0 self,
ip: IpAddr,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn forward<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<IpAddr>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn txt<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The DNS lookups this crate needs.
Abstracted so tests can drive every branch — no PTR, a mismatched forward record, a timeout — from canned data instead of the network.
Required Methods§
Sourcefn reverse<'life0, 'async_trait>(
&'life0 self,
ip: IpAddr,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reverse<'life0, 'async_trait>(
&'life0 self,
ip: IpAddr,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
PTR names for ip, or an error describing why the lookup failed.
Sourcefn forward<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<IpAddr>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn forward<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<IpAddr>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
A/AAAA addresses for name.
Sourcefn txt<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn txt<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
TXT records for name.
A record’s character-strings are concatenated (RFC 1035 §3.3.14): a value
over 255 octets arrives split. A dns-01 value never is, but a provider
padding the record would otherwise never match.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".