Skip to main content

DnsResolver

Trait DnsResolver 

Source
pub trait DnsResolver: Send + Sync {
    // Required methods
    fn lookup_badge<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fqdn: &'life1 Fqdn,
    ) -> Pin<Box<dyn Future<Output = Result<DnsLookupResult<BadgeRecord>, DnsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn lookup_tlsa<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fqdn: &'life1 Fqdn,
        port: u16,
    ) -> Pin<Box<dyn Future<Output = Result<DnsLookupResult<TlsaRecord>, DnsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn get_badge_records<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fqdn: &'life1 Fqdn,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<BadgeRecord>, DnsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_tlsa_records<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fqdn: &'life1 Fqdn,
        port: u16,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TlsaRecord>, DaneError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn find_badge_for_version<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        fqdn: &'life1 Fqdn,
        version: &'life2 Version,
    ) -> Pin<Box<dyn Future<Output = Result<Option<BadgeRecord>, DnsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn find_preferred_badge<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fqdn: &'life1 Fqdn,
    ) -> Pin<Box<dyn Future<Output = Result<Option<BadgeRecord>, DnsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

DNS resolver trait for looking up badge records and TLSA records.

Badge records are queried from _ans-badge.{fqdn} (primary) with fallback to _ra-badge.{fqdn} (legacy).

Required Methods§

Source

fn lookup_badge<'life0, 'life1, 'async_trait>( &'life0 self, fqdn: &'life1 Fqdn, ) -> Pin<Box<dyn Future<Output = Result<DnsLookupResult<BadgeRecord>, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query badge TXT records for an FQDN.

Implementations should query _ans-badge first, falling back to _ra-badge.

Source

fn lookup_tlsa<'life0, 'life1, 'async_trait>( &'life0 self, fqdn: &'life1 Fqdn, port: u16, ) -> Pin<Box<dyn Future<Output = Result<DnsLookupResult<TlsaRecord>, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query TLSA records for an FQDN and port.

Returns TLSA records from _<port>._tcp.<fqdn>. Used for DANE verification of server certificates.

Provided Methods§

Source

fn get_badge_records<'life0, 'life1, 'async_trait>( &'life0 self, fqdn: &'life1 Fqdn, ) -> Pin<Box<dyn Future<Output = Result<Vec<BadgeRecord>, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query all badge records and return them. Convenience method that unwraps the result.

Source

fn get_tlsa_records<'life0, 'life1, 'async_trait>( &'life0 self, fqdn: &'life1 Fqdn, port: u16, ) -> Pin<Box<dyn Future<Output = Result<Vec<TlsaRecord>, DaneError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get TLSA records, returning empty vec if not found.

Source

fn find_badge_for_version<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, fqdn: &'life1 Fqdn, version: &'life2 Version, ) -> Pin<Box<dyn Future<Output = Result<Option<BadgeRecord>, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find the badge record matching a specific version.

Source

fn find_preferred_badge<'life0, 'life1, 'async_trait>( &'life0 self, fqdn: &'life1 Fqdn, ) -> Pin<Box<dyn Future<Output = Result<Option<BadgeRecord>, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find the first ACTIVE badge (or any if none specified as active). During version changes, prefer newer versions.

Implementors§