A rust crate for using the Transport for London (TFL) API.
Note: This is currently WIP and not ready for use.
Using cargo
, add this to your project's Cargo.toml
:
toml
[dependencies]
tfl-api-wrapper = "0.1.1"
Currently only the version for the API is implemented.
500 Requests per min
(allows 500 requests per min).Primary key
section of your subscription, click on Show
and copy the value. You can use either of Primary key
or Secondary key
.Set the APP_KEY
environment variable.
Instantiate the Client
using:
rust
use tfl_api_wrapper::{Client, RequestBuilder};
let client = Client::new(env::var("APP_KEY").unwrap().into());
Here APP_KEY
could be either Primary key
or Secondary key
.
Get the API version:
rust
let ver = client.api_version().fetch().await.unwrap();
You can run the tests by running:
sh
APP_KEY=hjdhajsdas cargo test