Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver: Send {
    // Required method
    fn resolve(
        &self,
        host: &str,
        port: u16,
    ) -> impl Future<Output = Result<SocketAddr, Error>> + Send;
}
Expand description

Trait for a DNS resolver to resolve hostnames and ports to IP addresses.

Required Methods§

Source

fn resolve( &self, host: &str, port: u16, ) -> impl Future<Output = Result<SocketAddr, Error>> + Send

Resolve a hostname and port to an IP address, asynchronously.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§