ipinfo/rust

lookup for my current IP

Closed this issue · 1 comments

Hello,

I would like to obtain information about my current IP. It works, accidentally, by passing an empty string to lookup:

let config = ipinfo::IpInfoConfig::default();
let mut ipinfo = ipinfo::IpInfo::new(config)?;

let location = ipinfo.lookup("").await?;

This works fine because the resulting url matches the good API endpoint.

Is it possible to clarify this feature ? An Option is probably clearer or a dedicated function.

lookup_self_v4 and lookup_self_v6 are coming in the next release 3.1.0