This crate provides functionalities to retrieve your public IP. It uses hyper along with ipify. Works only on HTTP.
hyper
ipify
extern crate hyper; extern crate ipify_api; use hyper::rt::{self, Future}; fn main() { rt::run( ipify_api::get_ip("http://my-ipify-instance.rs") .map(|ip| println!("{}", ip)) .map_err(|e| println!("{}", e)), ); }