Skip to content

Instantly share code, notes, and snippets.

@claudioap
Created April 29, 2015 13:50
Show Gist options
  • Save claudioap/e12588835913863185d7 to your computer and use it in GitHub Desktop.
Save claudioap/e12588835913863185d7 to your computer and use it in GitHub Desktop.
Lookup hostname rust
use std::net;
fn main() {
let ip4 = net::Ipv4Addr::new(8,8,8,8);
let ip_enum = net::IpAddr(ip4);
let host = net::lookup_addr(ip_enum);
let pointer = &host;
println!("{:?}", pointer);
}
Compiler error:
src/main.rs:5:19: 5:30 error: unresolved name `net::IpAddr`
src/main.rs:5 let ip_enum = net::IpAddr(ip4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment