logistics-api

Crates.iologistics-api
lib.rslogistics-api
version0.1.6
sourcesrc
created_at2023-03-16 11:44:43.618873
updated_at2023-03-27 16:44:33.594156
descriptionTrack your packages from all over the world. Supports logicsitcs from DHL, UPS, FedEx, USPS, and more.
homepage
repositoryhttps://github.com/shahen94/logistics-api
max_upload_size
id811439
size7,288
Shahen Hovhannisyan (shahen94)

documentation

https://docs.rs/logistics-api

README

Logistics API

Supported APIs

  • DHL (✅)
  • UPS (🕒)
  • Fedex (🕒)

Usage

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),
  }
}
Commit count: 11

cargo fmt