ipify-async

Crates.ioipify-async
lib.rsipify-async
version0.1.1
sourcesrc
created_at2020-06-25 02:00:54.315577
updated_at2020-06-25 02:34:52.928788
descriptionA simple asynchronous library for obtaining your public IP
homepage
repository
max_upload_size
id257744
size3,621
Colin D. Bruner (colinbruner)

documentation

README

ipify-async

A simple asynchronous library for obtaining your public IP address within Rust code.

Example

The following is a simple example using the library while leveraging the tokio runtime.

use ipify_async;

type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>;

#[tokio::main]
async fn main() -> Result<()> {
    let ip = ipify_async::get_ip().await.unwrap().to_string();
    println!("{:?}", ip);
    Ok(())
}
Commit count: 0

cargo fmt