#ip-address #public-ip #fetch #ip-lookup #io #text #pingmyip

pingmyip-rs

A simple Rust library to fetch your public IP address from pingmyip.io

2 releases

0.0.2 Aug 5, 2024
0.0.1 Jul 6, 2024

#10 in #public-ip

Download history 59/week @ 2024-07-30 58/week @ 2024-08-06 19/week @ 2024-09-10 9/week @ 2024-09-17 12/week @ 2024-09-24 2/week @ 2024-10-01

72 downloads per month

MIT/Apache

3KB

PingMyIP

A simple Rust library to fetch your public IP address

Features

  • Fetch IP details in JSON format.
  • Fetch IP details in plain text format.

Installation

Add this to your Cargo.toml:

[dependencies]
pingmyip = "0.0.2"

Usage

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);
}

Dependencies

~6–19MB
~245K SLoC