Trait domain::resolv::resolver::Resolver[][src]

pub trait Resolver {
    type Octets: AsRef<[u8]>;
    type Answer: AsRef<Message<Self::Octets>>;
    type Query: Future<Output = Result<Self::Answer, Error>>;
    fn query<N, Q>(&self, question: Q) -> Self::Query
    where
        N: ToDname,
        Q: Into<Question<N>>
; }

A type that acts as a DNS resolver.

A resolver is anything that tries to answer questions using the DNS. The query method takes a single question and returns a future that will eventually resolve into either an answer or an IO error.

Associated Types

type Octets: AsRef<[u8]>[src]

type Answer: AsRef<Message<Self::Octets>>[src]

The answer returned by a query.

This isn’t Message directly as it may be useful for the resolver to provide additional information. For instance, a validating resolver (a resolver that checks whether DNSSEC signatures are correct) can supply more information as to why validation failed.

type Query: Future<Output = Result<Self::Answer, Error>>[src]

The future resolving into an answer.

Loading content...

Required methods

fn query<N, Q>(&self, question: Q) -> Self::Query where
    N: ToDname,
    Q: Into<Question<N>>, 
[src]

Returns a future answering a question.

The method takes anything that can be converted into a question and produces a future trying to answer the question.

Loading content...

Implementors

impl<'a> Resolver for &'a StubResolver[src]

type Octets = Bytes

type Answer = Answer

type Query = Pin<Box<dyn Future<Output = Result<Answer, Error>> + 'a>>

Loading content...