[][src]Struct gtfs_structures::Gtfs

pub struct Gtfs {
    pub read_duration: i64,
    pub calendar: HashMap<String, Calendar>,
    pub calendar_dates: HashMap<String, Vec<CalendarDate>>,
    pub stops: HashMap<String, Arc<Stop>>,
    pub routes: HashMap<String, Route>,
    pub trips: HashMap<String, Trip>,
    pub agencies: Vec<Agency>,
    pub shapes: HashMap<String, Vec<Shape>>,
    pub fare_attributes: HashMap<String, FareAttribute>,
    pub feed_info: Vec<FeedInfo>,
}

Data structure with all the GTFS objects

This structure is easier to use than the RawGtfs structure.

Fields

read_duration: i64calendar: HashMap<String, Calendar>calendar_dates: HashMap<String, Vec<CalendarDate>>stops: HashMap<String, Arc<Stop>>routes: HashMap<String, Route>trips: HashMap<String, Trip>agencies: Vec<Agency>shapes: HashMap<String, Vec<Shape>>fare_attributes: HashMap<String, FareAttribute>feed_info: Vec<FeedInfo>

Implementations

impl Gtfs[src]

pub fn print_stats(&self)[src]

pub fn new(gtfs: &str) -> Result<Gtfs, Error>[src]

Reads from an url (if starts with http), or a local path (either a directory or zipped file) To read from an url, build with read-url feature See also Gtfs::from_url and Gtfs::from_path if you don’t want the library to guess

pub fn from_path<P>(path: P) -> Result<Gtfs, Error> where
    P: AsRef<Path> + Display
[src]

Reads the GTFS from a local zip archive or local directory

pub fn from_url<U: IntoUrl>(url: U) -> Result<Gtfs, Error>[src]

Reads the GTFS from a remote url The library must be built with the read-url feature

pub async fn from_url_async<U: IntoUrl>(url: U) -> Result<Gtfs, Error>[src]

Asynchronously reads the GTFS from a remote url The library must be built with the read-url feature

pub fn from_reader<T: Read + Seek>(reader: T) -> Result<Gtfs, Error>[src]

pub fn trip_days(&self, service_id: &str, start_date: NaiveDate) -> Vec<u16>[src]

pub fn get_stop<'a>(&'a self, id: &str) -> Result<&'a Stop, Error>[src]

pub fn get_trip<'a>(&'a self, id: &str) -> Result<&'a Trip, Error>[src]

pub fn get_route<'a>(&'a self, id: &str) -> Result<&'a Route, Error>[src]

pub fn get_calendar<'a>(&'a self, id: &str) -> Result<&'a Calendar, Error>[src]

pub fn get_calendar_date<'a>(
    &'a self,
    id: &str
) -> Result<&'a Vec<CalendarDate>, Error>
[src]

pub fn get_shape<'a>(&'a self, id: &str) -> Result<&'a Vec<Shape>, Error>[src]

pub fn get_fare_attributes<'a>(
    &'a self,
    id: &str
) -> Result<&'a FareAttribute, Error>
[src]

Trait Implementations

impl Default for Gtfs[src]

impl TryFrom<RawGtfs> for Gtfs[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Gtfs

impl Send for Gtfs

impl Sync for Gtfs

impl Unpin for Gtfs

impl UnwindSafe for Gtfs

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.