Skip to main content

DnsResolver

Trait DnsResolver 

Source
pub trait DnsResolver:
    Send
    + Sync
    + 'static {
    // Required method
    fn resolve(
        &self,
        name: &str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SocketAddr>, OxiHttpError>> + Send>>;
}
Expand description

A pluggable async DNS resolver.

Implement this trait to override the default system resolver (getaddrinfo).

Required Methods§

Source

fn resolve( &self, name: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SocketAddr>, OxiHttpError>> + Send>>

Resolve name to a list of socket addresses.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§