get_ip

Function get_ip 

Source
pub fn get_ip() -> impl Future<Item = IP, Error = IpifyError>
Expand description

Resolves the IP address of the local machine by calling out to ipify.org.

Returns a future which resolves to this machine’s IP address.

Examples found in repository?
examples/get_ip.rs (line 9)
8fn main() {
9        let future = ipify_client::get_ip()
10            .map(|ip| {
11                println!("This machine's IP address: {}", ip);
12            })
13            .map_err(|e| {
14                eprintln!("failed to successfully resolve future: {:?}", e)
15            });
16    rt::run(future);
17}