[][src]Trait domain_resolv::resolver::Resolver

pub trait Resolver {
    type Answer: AsRef<Message>;
    type Query: Future<Item = Self::Answer, Error = Error>;
    fn query<N, Q>(&self, question: Q) -> Self::Query
    where
        N: ToDname,
        Q: Into<Question<N>>
; fn lookup_addr(&self, addr: IpAddr) -> LookupAddr<Self>
    where
        Self: Sized
, { ... }
fn lookup_host<N: ToDname>(&self, name: &N) -> LookupHost<Self>
    where
        Self: Sized
, { ... }
fn search_host<N>(self, name: N) -> SearchHost<Self, N>
    where
        Self: Sized + SearchNames,
        N: ToRelativeDname
, { ... }
fn lookup_srv<S, N>(
        self,
        service: S,
        name: N,
        fallback_port: u16
    ) -> LookupSrv<Self, S, N>
    where
        Self: Sized,
        S: ToRelativeDname + Clone + Send + 'static,
        N: ToDname + Send + 'static
, { ... } }

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 Answer: AsRef<Message>

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<Item = Self::Answer, Error = Error>

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>>, 

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

Provided methods

fn lookup_addr(&self, addr: IpAddr) -> LookupAddr<Self> where
    Self: Sized

fn lookup_host<N: ToDname>(&self, name: &N) -> LookupHost<Self> where
    Self: Sized

fn search_host<N>(self, name: N) -> SearchHost<Self, N> where
    Self: Sized + SearchNames,
    N: ToRelativeDname

fn lookup_srv<S, N>(
    self,
    service: S,
    name: N,
    fallback_port: u16
) -> LookupSrv<Self, S, N> where
    Self: Sized,
    S: ToRelativeDname + Clone + Send + 'static,
    N: ToDname + Send + 'static, 

Loading content...

Implementors

impl Resolver for StubResolver[src]

type Answer = Answer

type Query = Query

fn lookup_addr(&self, addr: IpAddr) -> LookupAddr<Self> where
    Self: Sized
[src]

fn lookup_host<N: ToDname>(&self, name: &N) -> LookupHost<Self> where
    Self: Sized
[src]

fn search_host<N>(self, name: N) -> SearchHost<Self, N> where
    Self: Sized + SearchNames,
    N: ToRelativeDname
[src]

fn lookup_srv<S, N>(
    self,
    service: S,
    name: N,
    fallback_port: u16
) -> LookupSrv<Self, S, N> where
    Self: Sized,
    S: ToRelativeDname + Clone + Send + 'static,
    N: ToDname + Send + 'static, 
[src]

Loading content...