[][src]Trait viaspf::Lookup

pub trait Lookup {
    fn lookup_a(&self, name: &Name) -> LookupResult<Vec<Ipv4Addr>>;
fn lookup_aaaa(&self, name: &Name) -> LookupResult<Vec<Ipv6Addr>>;
fn lookup_mx(&self, name: &Name) -> LookupResult<Vec<Name>>;
fn lookup_txt(&self, name: &Name) -> LookupResult<Vec<String>>;
fn lookup_ptr(&self, ip: IpAddr) -> LookupResult<Vec<Name>>; }

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

fn lookup_a(&self, name: &Name) -> LookupResult<Vec<Ipv4Addr>>

Looks up the IPv4 addresses for the given name.

Errors

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

fn lookup_aaaa(&self, name: &Name) -> LookupResult<Vec<Ipv6Addr>>

Looks up the IPv6 addresses for the given name.

Errors

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

fn lookup_mx(&self, name: &Name) -> LookupResult<Vec<Name>>

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.

fn lookup_txt(&self, name: &Name) -> LookupResult<Vec<String>>

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.

fn lookup_ptr(&self, ip: IpAddr) -> LookupResult<Vec<Name>>

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

Errors

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

Loading content...

Implementors

Loading content...