pub struct RawGtfs {
Show 19 fields pub read_duration: i64, 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 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: i64

Time needed to read and parse the archive in milliseconds

§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 FareAttribates, 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

§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: SourceFormat

Format 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

source

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

source

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

source

pub fn from_path<P>(path: P) -> Result<Self, Error>
where P: AsRef<Path>,

 Reads the raw GTFS from a local zip archive or local directory

source

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

source

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

source

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

Trait Implementations§

source§

impl Debug for RawGtfs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl TryFrom<RawGtfs> for Gtfs

source§

fn try_from(raw: RawGtfs) -> Result<Gtfs, Error>

Tries to build a Gtfs from a RawGtfs

It might fail if some mandatory files couldn’t be read or if there are references to other objects that are invalid.

§

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more