ipify-client

Crates.ioipify-client
lib.rsipify-client
version0.1.0
sourcesrc
created_at2018-08-04 21:35:24.940953
updated_at2018-08-04 21:35:24.940953
descriptionA client interface to the ipify.org IP resolution service
homepage
repositoryhttps://gitlab.com/wilsoniya/ipify-client
max_upload_size
id77528
size41,993
Michael Wilson (wilsoniya)

documentation

README

ipify-client

A Rust client interface to the ipify.org IP resolution service.

Usage

[dependencies]
ipify-client = "0.1.0"
extern crate futures;
extern crate hyper;
extern crate ipify_client;

use futures::Future;
use hyper::rt;

fn main() {
        let future = ipify_client::get_ip()
            .map(|ip| {
                println!("This machine's IP address: {}", ip);
            })
            .map_err(|e| {
                eprintln!("failed to successfully resolve future: {:?}", e)
            });
    rt::run(future);
}

Prints, e.g.:

This machine's IP address: 1.2.3.4
Commit count: 8

cargo fmt