ResolveHostname

Trait ResolveHostname 

Source
pub trait ResolveHostname {
    type Error: Debug;

    // Required method
    fn resolve_hostname(
        &mut self,
        hostname: &str,
    ) -> Result<SocketAddr, Self::Error>;
}
Expand description

Trait for resolving hostnames

A type implementing this trait can resolve a hostname to an IP address.

Required Associated Types§

Required Methods§

Source

fn resolve_hostname( &mut self, hostname: &str, ) -> Result<SocketAddr, Self::Error>

Resolve a hostname to an IP address

§Errors

An error will be returned if the hostname could not be resolved.

Implementors§