1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
//! # Amtrak Rust API
//!
//! Amtrak Rust API allows the caller to query the Amtrak API for information
//! about trains and stations in its network.
//!
//! Note: This library is not affiliated with Amtrak in any way and is an
//! unofficial implementation of the public facing API. Amtrak is a registered
//! trademark of the National Railroad Passenger Corporation.
//!
//! # Example usage
//! Here is an example of querying trains that have stopped at or will stop at a
//! specific station.
//!
//! ```rust
//! use amtrak_api::Client;
//!
//! const STATION_CODE: &str = "PHL";
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! Client::new()
//! .station(STATION_CODE)
//! .await?
//! .0
//! .values()
//! .for_each(|station| {
//! println!(
//! "Current train scheduled for station \"{}\": {}",
//! station.name,
//! station.trains.join(", ")
//! );
//! });
//!
//! Ok(())
//! }
//! ```
pub mod client;
pub mod errors;
pub mod responses;
pub use client::Client;