| Crates.io | yxhoo-transit |
| lib.rs | yxhoo-transit |
| version | 0.4.4 |
| created_at | 2025-12-19 11:34:44.209406+00 |
| updated_at | 2025-12-25 07:18:02.707033+00 |
| description | A client for Yxhoo! Transit (Japan) unofficial API |
| homepage | |
| repository | https://github.com/waki285/yxhoo-transit-rs |
| max_upload_size | |
| id | 1994633 |
| size | 127,816 |
A Rust client for Yxhoo! Transit (Japan) unofficial API. This crate provides functions to suggest places and search for transit routes using Yxhoo! Transit.
Add this to your Cargo.toml:
[dependencies]
yxhoo-transit = "0.4"
http-reqwest (default): Use reqwest as the HTTP client.http-wreq: Use wreq as the HTTP client.schemars: Enable JsonSchema derives for public types.use yxhoo_transit::{suggest_places, transit, args::{TransitArgs, DateKind}};
#[tokio::main]
async fn main() {
// Suggest places
let suggestions = suggest_places("新宿").await.unwrap();
println!("{:?}", suggestions);
// Transit search
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.unwrap();
println!("{:?}", result);
}
Apache-2.0