I would like to announce the arrival of lta-rs v0.3.0!
lta-rs is a client to interact with Singapore's Datamall APIs implemented in Rust. In this version, there were quite a few changes and let me go through some of the highlights
- Refactored modules to separate crates which can be enabled by features
async
andblocking
- Added support for
async/await
. Internally, the whole library usesasync/await
to simplify writing asynchronous programs - General internal code clean up
In terms of development, lta-rs has moved on from travis.ci
to Azure Pipelines
to have more insights regarding compilation on Windows
and MacOS
.
lta-rs async/await in action
Put this in your cargo.toml
[dependencies]
lta = { version = "0.3.0", features = ["async"] }
use std::env;
use lta::prelude::*;
use lta::r#async::{
bus::get_arrival,
lta_client::LTAClient
};
#[tokio::main]
async fn fut() -> LTAResult<()> {
let api_key = env::var("API_KEY").expect("API_KEY must be set!");
let client = LTAClient::with_api_key(api_key);
let arrivals_one = get_arrival(&client, 83139, None).await?;
let arrivals_two = get_arrival(&client, 83139, None).await?;
println!("{:?} \n{:?}", arrivals_one, arrivals_two);
Ok(())
}
I would like to thank those who have supported me in building library. That's all folks!