Mercurial > core / rust/lib/tenex/models/ipapi/lib.rs
changeset 698: |
96958d3eb5b0 |
parent: |
0ccbbd142694
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
2 use reqwest::{Client, Error}; 5 pub async fn my_ip_verbose() -> Result<serde_json::Value, Error> { 6 let echo_json = Client::new() 7 .get("https://ipwhois.app/json/") 13 trace!("{:#?}", echo_json); 17 pub async fn my_ip() -> Result<IpAddr, Error> { 18 let res = Client::new() 19 .get("https://ipinfo.io/ip") 25 Ok(res.parse().unwrap()) 28 pub async fn get_ip() -> Result<(), Error> { 29 let ip = my_ip().await?; 30 println!("PUBLIC_IP : {:#?}", ip);