Crates.io | pingmyip-rs |
lib.rs | pingmyip-rs |
version | 0.0.2 |
source | src |
created_at | 2024-07-06 08:30:32.421108 |
updated_at | 2024-08-05 17:26:54.708663 |
description | A simple Rust library to fetch your public IP address from pingmyip.io |
homepage | |
repository | https://github.com/codanaut/pingmyip-rs |
max_upload_size | |
id | 1293850 |
size | 2,999 |
A simple Rust library to fetch your public IP address
Add this to your Cargo.toml
:
[dependencies]
pingmyip = "0.0.2"
Example of using PingMyIP:
async fn get_ip_details() {
let json_details = pingmyip::fetch_ip_json().await.unwrap();
println!("IP Details in JSON: {}", json_details);
let text_details = pingmyip::fetch_ip_text().await.unwrap();
println!("IP Details in Text: {}", text_details);
}