Traintime
Live train arrivals for a display on my wall, built to learn Rust properly.
What it does
Pick a transit system and a station. Traintime downloads the system's static GTFS schedule, polls its GTFS-Realtime feeds, and emits a stream of compact arrival packets: line, destination, minutes until arrival, and delay. Systems are defined in YAML, and NYC Subway, MBTA, and Metro-North are configured today.
Design
- One station, many stop IDs. Transit agencies often split one physical station into several stop IDs, by platform or by line. Traintime groups them with a disjoint-set built from transfer and name data, so picking "Times Sq" covers every platform.
- Filtering early. Irrelevant transfers are dropped before they're loaded into memory. Canceled trips, skipped stops, and trains terminating at your station never become packets.
- No panics. Outside tests, Clippy denies
unwrap,expect, andpanic!. - Workspace layout. A library crate holds the server logic and a thin CLI crate sits on top. Integration tests run against recorded feed data, and CI builds, lints, and tests every push.
Next
Moving the display onto a microcontroller. The packet type moves into a shared no_std crate used by both the server and the firmware, and the firmware gets its own SPI display driver.