pub struct RawGtfs {Show 22 fields
pub read_duration: Duration,
pub calendar: Option<Result<Vec<Calendar>, Error>>,
pub calendar_dates: Option<Result<Vec<CalendarDate>, Error>>,
pub stops: Result<Vec<Stop>, Error>,
pub routes: Result<Vec<Route>, Error>,
pub trips: Result<Vec<RawTrip>, Error>,
pub agencies: Result<Vec<Agency>, Error>,
pub shapes: Option<Result<Vec<Shape>, Error>>,
pub fare_attributes: Option<Result<Vec<FareAttribute>, Error>>,
pub fare_rules: Option<Result<Vec<FareRule>, Error>>,
pub fare_products: Option<Result<Vec<FareProduct>, Error>>,
pub fare_media: Option<Result<Vec<FareMedia>, Error>>,
pub rider_categories: Option<Result<Vec<RiderCategory>, Error>>,
pub frequencies: Option<Result<Vec<RawFrequency>, Error>>,
pub transfers: Option<Result<Vec<RawTransfer>, Error>>,
pub pathways: Option<Result<Vec<RawPathway>, Error>>,
pub feed_info: Option<Result<Vec<FeedInfo>, Error>>,
pub stop_times: Result<Vec<RawStopTime>, Error>,
pub files: Vec<String>,
pub source_format: SourceFormat,
pub sha256: Option<String>,
pub translations: Option<Result<Vec<RawTranslation>, Error>>,
}Expand description
Data structure that map the GTFS csv with little intelligence
This is used to analyze the GTFS and detect anomalies To manipulate the transit data, maybe crate::Gtfs will be more convienient
Fields§
§read_duration: DurationTime needed to read and parse the archive
calendar: Option<Result<Vec<Calendar>, Error>>All Calendar, None if the file was absent as it is not mandatory
calendar_dates: Option<Result<Vec<CalendarDate>, Error>>All Calendar dates, None if the file was absent as it is not mandatory
stops: Result<Vec<Stop>, Error>All Stops
routes: Result<Vec<Route>, Error>All Routes
trips: Result<Vec<RawTrip>, Error>All Trips
agencies: Result<Vec<Agency>, Error>All Agencies
shapes: Option<Result<Vec<Shape>, Error>>All shapes points, None if the file was absent as it is not mandatory
fare_attributes: Option<Result<Vec<FareAttribute>, Error>>All FareAttributes, None if the file was absent as it is not mandatory
fare_rules: Option<Result<Vec<FareRule>, Error>>All FareRules, None if the file was absent as it is not mandatory
fare_products: Option<Result<Vec<FareProduct>, Error>>All FareProducts, None if the file was absent as it is not mandatory
fare_media: Option<Result<Vec<FareMedia>, Error>>All FareMedias, None if the file was absent as it is not mandatory
rider_categories: Option<Result<Vec<RiderCategory>, Error>>All RiderCategories, None if the file was absent as it is not mandatory
frequencies: Option<Result<Vec<RawFrequency>, Error>>All Frequencies, None if the file was absent as it is not mandatory
transfers: Option<Result<Vec<RawTransfer>, Error>>All Transfers, None if the file was absent as it is not mandatory
pathways: Option<Result<Vec<RawPathway>, Error>>All Pathways, None if the file was absent as it is not mandatory
feed_info: Option<Result<Vec<FeedInfo>, Error>>All FeedInfo, None if the file was absent as it is not mandatory
stop_times: Result<Vec<RawStopTime>, Error>All StopTimes
files: Vec<String>All files that are present in the feed
source_format: SourceFormatFormat of the data read
sha256: Option<String>sha256 sum of the feed
translations: Option<Result<Vec<RawTranslation>, Error>>All translations, None if the file was absent as it is not mandatory
Implementations§
Source§impl RawGtfs
impl RawGtfs
Sourcepub fn print_stats(&self)
pub fn print_stats(&self)
Prints on stdout some basic statistics about the GTFS file (numbers of elements for each object). Mostly to be sure that everything was read
Sourcepub fn new(gtfs: &str) -> Result<Self, Error>
pub fn new(gtfs: &str) -> Result<Self, Error>
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 RawGtfs::from_url and RawGtfs::from_path if you don’t want the library to guess
Sourcepub fn from_path<P>(path: P) -> Result<Self, Error>
pub fn from_path<P>(path: P) -> Result<Self, Error>
Reads the raw GTFS from a local zip archive or local directory
Sourcepub fn from_url<U: IntoUrl>(url: U) -> Result<Self, Error>
pub fn from_url<U: IntoUrl>(url: U) -> Result<Self, Error>
Reads the raw GTFS from a remote url
The library must be built with the read-url feature. Not available on WASM targets.
Sourcepub async fn from_url_async<U: IntoUrl>(url: U) -> Result<Self, Error>
pub async fn from_url_async<U: IntoUrl>(url: U) -> Result<Self, Error>
Non-blocking read the raw GTFS from a remote url
The library must be built with the read-url feature
Sourcepub fn from_reader<T: Read + Seek>(reader: T) -> Result<Self, Error>
pub fn from_reader<T: Read + Seek>(reader: T) -> Result<Self, Error>
Reads for any object implementing std::io::Read and std::io::Seek
Mostly an internal function that abstracts reading from an url or local file