Skip to main content

DnsCache

Trait DnsCache 

Source
pub trait DnsCache {
    type Txt: ResolverCache<Box<str>, TxtRecord>;
    type Mx: ResolverCache<Box<str>, Result<RecordSet<Mx>, Negative>>;
    type Ipv4: ResolverCache<Box<str>, Result<RecordSet<Ipv4Addr>, Negative>>;
    type Ipv6: ResolverCache<Box<str>, Result<RecordSet<Ipv6Addr>, Negative>>;
    type Ptr: ResolverCache<IpAddr, Result<RecordSet<Box<str>>, Negative>>;

    // Required methods
    fn txt(&self) -> Option<&Self::Txt>;
    fn mx(&self) -> Option<&Self::Mx>;
    fn ipv4(&self) -> Option<&Self::Ipv4>;
    fn ipv6(&self) -> Option<&Self::Ipv6>;
    fn ptr(&self) -> Option<&Self::Ptr>;
}
Expand description

A set of DNS caches, one per record type, passed to verifiers through Parameters::with_cache.

An accessor that returns None disables caching for that record type. See the module documentation for an example.

Required Associated Types§

Source

type Txt: ResolverCache<Box<str>, TxtRecord>

Cache for parsed TXT records (SPF, DKIM, DMARC, ATPS, MTA-STS, TLSRPT), keyed by fully qualified domain name.

Source

type Mx: ResolverCache<Box<str>, Result<RecordSet<Mx>, Negative>>

Cache for MX records and negative MX answers, keyed by fully qualified domain name.

Source

type Ipv4: ResolverCache<Box<str>, Result<RecordSet<Ipv4Addr>, Negative>>

Cache for A records and negative A answers, keyed by fully qualified domain name.

Source

type Ipv6: ResolverCache<Box<str>, Result<RecordSet<Ipv6Addr>, Negative>>

Cache for AAAA records and negative AAAA answers, keyed by fully qualified domain name.

Source

type Ptr: ResolverCache<IpAddr, Result<RecordSet<Box<str>>, Negative>>

Cache for PTR records and negative PTR answers, keyed by IP address.

Required Methods§

Source

fn txt(&self) -> Option<&Self::Txt>

Returns the TXT record cache, or None to disable it.

Source

fn mx(&self) -> Option<&Self::Mx>

Returns the MX record cache, or None to disable it.

Source

fn ipv4(&self) -> Option<&Self::Ipv4>

Returns the A record cache, or None to disable it.

Source

fn ipv6(&self) -> Option<&Self::Ipv6>

Returns the AAAA record cache, or None to disable it.

Source

fn ptr(&self) -> Option<&Self::Ptr>

Returns the PTR record cache, or None to disable it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§