Function my_internet_ip::get[][src]

pub fn get() -> Result<IpAddr, MyIpError>

Try to retrieve the public IP of the device this code is executed on.

Example

let ip: ::std::net::IpAddr = match my_internet_ip::get() {
    Ok(ip) => ip,
    Err(e) => panic!("Could not get IP: {:?}", e)
};

// Do something with the IP, e.g. print it