Crates.io | logistics-api |
lib.rs | logistics-api |
version | 0.1.6 |
source | src |
created_at | 2023-03-16 11:44:43.618873 |
updated_at | 2023-03-27 16:44:33.594156 |
description | Track your packages from all over the world. Supports logicsitcs from DHL, UPS, FedEx, USPS, and more. |
homepage | |
repository | https://github.com/shahen94/logistics-api |
max_upload_size | |
id | 811439 |
size | 7,288 |
With Blocking I/O
use logistics_api::DHL;
fn main() {
let dhl = DHL::new("YOUR_API_KEY");
let tracking = dhl.tracking.get_tracking_sync("YOUR_TRACKING_NUMBER");
match tracking {
Ok(tracking) => println!("{:#?}", tracking),
Err(err) => println!("{:#?}", err),
}
}
Using Async I/O
use logistics_api::DHL;
#[tokio::main]
async fn main() {
let dhl = DHL::new("YOUR_API_KEY");
let tracking = dhl.tracking.get_tracking("YOUR_TRACKING_NUMBER").await;
match tracking {
Ok(tracking) => println!("{:#?}", tracking),
Err(err) => println!("{:#?}", err),
}
}