Trait viaspf::Lookup[][src]

pub trait Lookup {
    fn lookup_a<'res, 'a, 'async_trait>(
        &'res self,
        name: &'a Name
    ) -> Pin<Box<dyn Future<Output = LookupResult<Vec<Ipv4Addr>>> + Send + 'async_trait>>
    where
        'res: 'async_trait,
        'a: 'async_trait,
        Self: 'async_trait
;
fn lookup_aaaa<'res, 'a, 'async_trait>(
        &'res self,
        name: &'a Name
    ) -> Pin<Box<dyn Future<Output = LookupResult<Vec<Ipv6Addr>>> + Send + 'async_trait>>
    where
        'res: 'async_trait,
        'a: 'async_trait,
        Self: 'async_trait
;
fn lookup_mx<'res, 'a, 'async_trait>(
        &'res self,
        name: &'a Name
    ) -> Pin<Box<dyn Future<Output = LookupResult<Vec<Name>>> + Send + 'async_trait>>
    where
        'res: 'async_trait,
        'a: 'async_trait,
        Self: 'async_trait
;
fn lookup_txt<'res, 'a, 'async_trait>(
        &'res self,
        name: &'a Name
    ) -> Pin<Box<dyn Future<Output = LookupResult<Vec<String>>> + Send + 'async_trait>>
    where
        'res: 'async_trait,
        'a: 'async_trait,
        Self: 'async_trait
;
fn lookup_ptr<'res, 'async_trait>(
        &'res self,
        ip: IpAddr
    ) -> Pin<Box<dyn Future<Output = LookupResult<Vec<Name>>> + Send + 'async_trait>>
    where
        'res: 'async_trait,
        Self: 'async_trait
; }
Expand description

A trait for entities that perform DNS resolution.

This trait uses the Name type in arguments and return values. See the documentation of this type for a discussion of its design and use.

Required methods

Looks up the IPv4 addresses for the given name.

Errors

If the lookup encounters an error, a LookupError variant is returned.

Looks up the IPv6 addresses for the given name.

Errors

If the lookup encounters an error, a LookupError variant is returned.

Looks up the mail exchanger names for the given name.

Implementers may want to order the returned vector by MX preference.

Errors

If the lookup encounters an error, a LookupError variant is returned.

Looks up the text records for the given name.

Implementers should make sure that invalid UTF-8 does not cause the lookup to fail (eg, using a lossy transformation). A record consisting of multiple elements should be returned as one string, with elements joined without a separator.

Errors

If the lookup encounters an error, a LookupError variant is returned.

Looks up the names for the given address (reverse lookup).

Errors

If the lookup encounters an error, a LookupError variant is returned.

Implementors