Trait rama::dns::DnsResolver

pub trait DnsResolver:
    Send
    + Sync
    + 'static {
    type Error;

    // Required methods
    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;
}
Expand description

A resolver of domains into IP addresses.

Required Associated Types§

type Error

Error returned by the DnsResolver

Required Methods§

fn ipv4_lookup( &self, domain: Domain, ) -> impl Future<Output = Result<Vec<Ipv4Addr>, Self::Error>> + Send

Resolve the ‘A’ records accessible by this resolver for the given Domain into Ipv4Addresses.

fn ipv6_lookup( &self, domain: Domain, ) -> impl Future<Output = Result<Vec<Ipv6Addr>, Self::Error>> + Send

Resolve the ‘AAAA’ records accessible by this resolver for the given Domain into Ipv6Addresses.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<R> DnsResolver for Option<R>
where R: DnsResolver, <R as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

async fn ipv4_lookup( &self, domain: Domain, ) -> Result<Vec<Ipv4Addr>, <Option<R> as DnsResolver>::Error>

§

async fn ipv6_lookup( &self, domain: Domain, ) -> Result<Vec<Ipv6Addr>, <Option<R> as DnsResolver>::Error>

§

impl<R> DnsResolver for Arc<R>
where R: DnsResolver,

§

type Error = <R as DnsResolver>::Error

§

fn ipv4_lookup( &self, domain: Domain, ) -> impl Future<Output = Result<Vec<Ipv4Addr>, <Arc<R> as DnsResolver>::Error>> + Send

§

fn ipv6_lookup( &self, domain: Domain, ) -> impl Future<Output = Result<Vec<Ipv6Addr>, <Arc<R> as DnsResolver>::Error>> + Send

Implementors§

§

impl DnsResolver for DenyAllDns

§

impl DnsResolver for HickoryDns

§

impl DnsResolver for InMemoryDns

§

impl<A, B> DnsResolver for Either<A, B>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C> DnsResolver for Either3<A, B, C>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D> DnsResolver for Either4<A, B, C, D>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, D: DnsResolver, <D as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E> DnsResolver for Either5<A, B, C, D, E>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, D: DnsResolver, <D as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, E: DnsResolver, <E as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F> DnsResolver for Either6<A, B, C, D, E, F>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, D: DnsResolver, <D as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, E: DnsResolver, <E as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, F: DnsResolver, <F as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G> DnsResolver for Either7<A, B, C, D, E, F, G>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, D: DnsResolver, <D as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, E: DnsResolver, <E as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, F: DnsResolver, <F as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, G: DnsResolver, <G as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G, H> DnsResolver for Either8<A, B, C, D, E, F, G, H>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, D: DnsResolver, <D as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, E: DnsResolver, <E as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, F: DnsResolver, <F as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, G: DnsResolver, <G as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, H: DnsResolver, <H as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G, H, I> DnsResolver for Either9<A, B, C, D, E, F, G, H, I>
where A: DnsResolver, <A as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, B: DnsResolver, <B as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, C: DnsResolver, <C as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, D: DnsResolver, <D as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, E: DnsResolver, <E as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, F: DnsResolver, <F as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, G: DnsResolver, <G as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, H: DnsResolver, <H as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>, I: DnsResolver, <I as DnsResolver>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>