Registry / networking / public-ip

public-ip

JSON →
library0.2.2rscratesunverified

Find the public IP address of a device.

# Cargo.toml [dependencies] public-ip = "0.2.2"
INSTALL
IMPORT
SIG · PUBLIC-IP
P
public-ip
networkingrustv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

addr
use public_ip::addr;

Get the public IP address asynchronously.

use public_ip::addr; #[tokio::main] async fn main() { let ip = addr().await.unwrap(); println!("{}", ip); }
Debug
Known issues
gotchaRequires an async runtime like Tokio.
fix
Add `tokio` as a dependency and use `#[tokio::main]`.
affects: >=0.2.0
Upgrade
Version history
0.2.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
public-ip — cargo add public-ip · libregistry