Skip to content
Public transit serializer/deserializer and manipulation library for Rust
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benches
examples
src
tests
.gitignore
Cargo.toml
LICENSE
README.md

README.md

Transit

Fast transit library for Rust that provides GTFS serialization/deserialization, validation, and manipulation.

Usage

For files on your file system just us GTFSIterator::from_path

extern crate transitfeed;
use transitfeed::{GTFSIterator, Agency};

fn read_agencies() {
    let iterator : GTFSIterator<_, Agency> = GTFSIterator::from_path("~/Downloads/gtfs/agency.txt").unwrap();
    for result in iterator {
        match result {
            Ok(entry) => println!("{:?}", entry),
            Err(err) => println!("{}", err),
        };
    }
}

If you have your own csv::Reader then just give GTFSIterator::new a meaningful name

let iterator : GTFSIterator<_, Agency> = GTFSIterator::new(reader, "example_data").unwrap();
for result in iterator {
    match result {
        Ok(entry) => println!("{:?}", entry),
        Err(err) => println!("{}", err),
    };
}
You can’t perform that action at this time.