wmata

wmata is a high level async Rust interface to the Washington Metropolitan Area Transit Authority API.

Contents

Requirements

Installation

Cargo

toml wmata = "7.0.0"

Usage

Getting Started

```rust use wmata::{MetroRail, Station};

let client = MetroRail::new(api_key);

let trains = client.next_trains(Station::A01).await?; ```

Design

wmata breaks the WMATA API into two components: MetroRail and MetroBus.

MetroRail

Provides access to all MetroRail related endpoints.

Using MetroRail

```rust use wmata::{MetroRail, Station};

let client = MetroRail::new(api_key);

let trains = client.next_trains(Station::A01).await?; ```

MetroBus

Provides access to all MetroBus related endpoints.

Using MetroBus

```rust use wmata::MetroBus;

let client = MetroBus::new(api_key);

let routes = client.routes().await?; ```

Testing

Note that tests must currently be run with --test-threads 1 in order to pass, due to using live data.

Dependencies

Contact

Feel free to email questions and comments to emma@emma.sh

License

wmata is released under the MIT license. See LICENSE for details.