get_ip

Function get_ip 

Source
pub fn get_ip(url: &str) -> impl Future<Item = String, Error = Error>
Expand description

This function takes an ipify endpoint to query. Works only on HTTP. If an empty string is given, it uses the default (http://api.ipify.org)


     get_ip("http://my-custom-ipify-instance.rs")
         .map(|ip| println!("{}", ip))
         .map_err(|e| println!("{}", e));