Trait DnsResolver
pub trait DnsResolver:
Sized
+ Send
+ Sync
+ 'static {
type Error: Into<Box<dyn Error + Sync + Send>> + Send + 'static;
// Required methods
fn txt_lookup(
&self,
domain: Domain,
) -> impl Future<Output = Result<Vec<Vec<u8>>, Self::Error>> + Send;
fn ipv4_lookup(
&self,
domain: Domain,
) -> impl Future<Output = Result<Vec<Ipv4Addr>, Self::Error>> + Send;
fn ipv6_lookup(
&self,
domain: Domain,
) -> impl Future<Output = Result<Vec<Ipv6Addr>, Self::Error>> + Send;
// Provided method
fn boxed(self) -> BoxDnsResolver { ... }
}
Expand description
A resolver of domains and other dns data.
Required Associated Types§
Required Methods§
fn txt_lookup(
&self,
domain: Domain,
) -> impl Future<Output = Result<Vec<Vec<u8>>, Self::Error>> + Send
fn txt_lookup( &self, domain: Domain, ) -> impl Future<Output = Result<Vec<Vec<u8>>, Self::Error>> + Send
Resolve the ‘TXT’ records accessible by this resolver for the given key.
Provided Methods§
fn boxed(self) -> BoxDnsResolver
fn boxed(self) -> BoxDnsResolver
Box this resolver to allow for dynamic dispatch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.