[][src]Struct domain_resolv::stub::StubResolver

pub struct StubResolver { /* fields omitted */ }

A DNS stub resolver.

This type collects all information making it possible to start DNS queries. You can create a new resoler using the system’s configuration using the new() associate function or using your own configuration with from_conf().

Stub resolver values can be cloned relatively cheaply as they keep all information behind an arc.

If you want to run a single query or lookup on a resolver synchronously, you can do so simply by using the run() or run_with_conf() associated functions.

Implementations

impl StubResolver[src]

pub fn new() -> Self[src]

Creates a new resolver using the system’s default configuration.

pub fn from_conf(conf: ResolvConf) -> Self[src]

Creates a new resolver using the given configuraiton.

pub fn options(&self) -> &ResolvOptions[src]

pub async fn query<N: ToDname, Q: Into<Question<N>>, '_>(
    &'_ self,
    question: Q
) -> Result<Answer, Error>
[src]

impl StubResolver[src]

pub async fn lookup_addr<'_, '_>(
    &'_ self,
    addr: IpAddr
) -> Result<FoundAddrs<&'_ Self>, Error>
[src]

pub async fn lookup_host<'_, '_>(
    &'_ self,
    qname: impl ToDname
) -> Result<FoundHosts<&'_ Self>, Error>
[src]

pub async fn search_host<'_, '_>(
    &'_ self,
    qname: impl ToRelativeDname
) -> Result<FoundHosts<&'_ Self>, Error>
[src]

pub async fn lookup_srv<'_>(
    &'_ self,
    service: impl ToRelativeDname,
    name: impl ToDname,
    fallback_port: u16
) -> Result<Option<FoundSrvs>, SrvError>
[src]

Trait Implementations

impl Clone for StubResolver[src]

impl Debug for StubResolver[src]

impl Default for StubResolver[src]

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

type Octets = Bytes

type Answer = Answer

The answer returned by a query. Read more

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

The future resolving into an answer.

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

type Name = SearchSuffix

type Iter = SearchIter<'a>

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,