[][src]Function polonium::resolve

pub fn resolve(address: &str) -> Result<SocketAddr, Error>

Perform the DNS resolution of given hostname (if any)

Examples

use polonium::resolve;
use std::net::{SocketAddrV4, SocketAddr};
let addr = resolve("localhost:80");
assert_eq!(addr.unwrap(), SocketAddr::from(([127, 0, 0, 1], 80)));