yxhoo-transit

Crates.ioyxhoo-transit
lib.rsyxhoo-transit
version0.4.4
created_at2025-12-19 11:34:44.209406+00
updated_at2025-12-25 07:18:02.707033+00
descriptionA client for Yxhoo! Transit (Japan) unofficial API
homepage
repositoryhttps://github.com/waki285/yxhoo-transit-rs
max_upload_size
id1994633
size127,816
すずねーう (waki285)

documentation

README

yxhoo-transit

crates.io docs.rs downloads license CI

日本語 README

A Rust client for Yxhoo! Transit (Japan) unofficial API. This crate provides functions to suggest places and search for transit routes using Yxhoo! Transit.

Usage

Add this to your Cargo.toml:

[dependencies]
yxhoo-transit = "0.4"

Features

  • http-reqwest (default): Use reqwest as the HTTP client.
  • http-wreq: Use wreq as the HTTP client.
  • schemars: Enable JsonSchema derives for public types.

Example

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);
}

License

Apache-2.0

Commit count: 0

cargo fmt