Skip to main content

Resolve

Trait Resolve 

Source
pub trait Resolve: Send + Sync {
    // Required method
    fn resolve(&self, host: &str, port: u16) -> Result<Vec<SocketAddr>>;
}
Expand description

Name resolution, injectable so tests can map names without a DNS server.

Required Methods§

Source

fn resolve(&self, host: &str, port: u16) -> Result<Vec<SocketAddr>>

Every address the DNS name host resolves to, with port attached. IP literals never reach the resolver.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§