wmata 1.0.0

wmata is a lightweight Rust interface to the Washington Metropolitan Area Transit Authority (WMATA) API
Documentation

wmata

wmata is a lightweight Rust interface to the Washington Metropolitan Area Transit Authority API.

Contents

Requirements

  • Rust 2018

Installation

Cargo

wmata = "1.0.0"

Usage

Getting Started

use wmata::RailClient;

let client = RailClient::new(api_key);

let trains = client.next_trains()?;

Design

wmata breaks the WMATA API into two components: RailClient and BusClient.

RailClient

Provides access to all MetroRail related endpoints.

BusClient

Provides access to all MetroBus related endpoints.

Using RailClient

use wmata::RailClient;

let client = RailClient::new(api_key);

let trains = client.next_trains()?;

Using BusClient

use wmata::BusClient;

let client = BusClient::new(api_key);

let routes = client.routes()?;

Dependencies

  • serde
  • serde_json
  • reqwest

Contact

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

License

WMATA.swift is released under the MIT license. See LICENSE for details.