Resolver

Trait Resolver 

Source
pub trait Resolver:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn lookup_ipv4(
        &self,
        host: String,
    ) -> BoxFuture<Result<BoxIter<Ipv4Addr>, DnsError>>;
    fn lookup_ipv6(
        &self,
        host: String,
    ) -> BoxFuture<Result<BoxIter<Ipv6Addr>, DnsError>>;
    fn lookup_txt(
        &self,
        host: String,
    ) -> BoxFuture<Result<BoxIter<TxtRecordData>, DnsError>>;
    fn clear_cache(&self);
    fn reset(&mut self);
}
Available on non-wasm_browser only.
Expand description

Trait for DNS resolvers used in iroh.

Required Methods§

Source

fn lookup_ipv4( &self, host: String, ) -> BoxFuture<Result<BoxIter<Ipv4Addr>, DnsError>>

Looks up an IPv4 address.

Source

fn lookup_ipv6( &self, host: String, ) -> BoxFuture<Result<BoxIter<Ipv6Addr>, DnsError>>

Looks up an IPv6 address.

Source

fn lookup_txt( &self, host: String, ) -> BoxFuture<Result<BoxIter<TxtRecordData>, DnsError>>

Looks up TXT records.

Source

fn clear_cache(&self)

Clears the internal cache.

Source

fn reset(&mut self)

Completely resets the DNS resolver.

This is called when the host’s network changes majorly. Implementations should rebind all sockets and refresh the nameserver configuration if read from the host system.

Implementors§