public-ip

Crates.iopublic-ip
lib.rspublic-ip
version0.2.2
sourcesrc
created_at2020-01-19 11:33:03.436807
updated_at2022-01-07 18:31:25.375557
descriptionFind the public IP address of a device
homepagehttps://github.com/avitex/rust-public-ip
repositoryhttps://github.com/avitex/rust-public-ip
max_upload_size
id200074
size60,112
James (avitex)

documentation

https://docs.rs/public-ip

README

Build Status Crate Docs

rust-public-ip

Find the public IP address of a device
Documentation hosted on docs.rs.

public-ip = "0.2"

Example usage

#[tokio::main]
async fn main() {
    // Attempt to get an IP address and print it.
    if let Some(ip) = public_ip::addr().await {
        println!("public ip address: {:?}", ip);
    } else {
        println!("couldn't get an IP address");
    }
}
Commit count: 45

cargo fmt