Expand description
§yxhoo-transit
A Rust client for the unofficial Yxhoo! Transit (Japan) API.
§Feature flags
Exactly one HTTP client feature must be enabled.
http-reqwest(default)http-wreqschemars: EnableJsonSchemaderives for public types.
# default (reqwest)
cargo test
# wreq
cargo test --no-default-features --features http-wreq,schemars§Example
use yxhoo_transit::{suggest_places, transit, args::{TransitArgs, DateKind}};
let suggestions = suggest_places("新宿").await?;
println!("{:?}", suggestions);
let args = TransitArgs {
from: "新宿".into(),
to: "渋谷".into(),
date: chrono::Local::now().into(),
date_kind: DateKind::DepartureTime,
rank: 1,
..Default::default()
};
let result = transit(&args).await?;
println!("{:?}", result);§Notes
This crate uses an unofficial API and may break without notice.
Modules§
Structs§
- Yxhoo
Place - Suggested place entry.
- Yxhoo
Suggest Response - Suggest API response payload.
Enums§
- Yxhoo
Place Kind - Kind of suggested place returned by Yxhoo.
Functions§
- suggest_
places - Suggest places by a free-form query string.
- transit
- Search transit routes using the given arguments.