public-ip-addr

Crates.iopublic-ip-addr
lib.rspublic-ip-addr
version0.1.0
sourcesrc
created_at2023-01-30 10:59:41.121453
updated_at2023-01-30 10:59:41.121453
descriptionA simple library for getting your public IP address
homepage
repositoryhttps://github.com/tsirysndr/public-ip-addr
max_upload_size
id771666
size56,921
Tsiry Sandratraina (tsirysndr)

documentation

README

public-ip-addr

License: MIT

A simple library to get your public IP address.

Usage

Add this to your Cargo.toml:

[dependencies]
public-ip-addr = "0.1"

Example

use public_ip_addr::get_public_ip;

#[tokio::main]
async fn main() {
    let ip = get_public_ip().await.unwrap();
    println!("Your public IP is: {}", ip);
}
Commit count: 1

cargo fmt