pub struct GtfsGenerator { /* private fields */ }
Expand description
Incomplete GTFS feed
Implementations§
Source§impl GtfsGenerator
impl GtfsGenerator
Sourcepub fn new() -> GtfsGenerator
pub fn new() -> GtfsGenerator
Create a new GTFS generator
Sourcepub fn add_agency(&mut self, agency: Agency) -> Result<()>
pub fn add_agency(&mut self, agency: Agency) -> Result<()>
Add an agency
See https://gtfs.org/schedule/reference/#agencytxt for rules of the individual fields
Note: This crate requires agency IDs to be set, even if there’s only a single agency.
Sourcepub fn add_stop(&mut self, stop: Stop) -> Result<()>
pub fn add_stop(&mut self, stop: Stop) -> Result<()>
Add a stop
See https://gtfs.org/schedule/reference/#stopstxt for rules of the individual fields
Sourcepub fn add_route(&mut self, route: Route) -> Result<()>
pub fn add_route(&mut self, route: Route) -> Result<()>
Add a route
See https://gtfs.org/schedule/reference/#routestxt for rules of the individual fields
Note: This crate requires agency IDs to be set, even if there’s only a single agency.
Sourcepub fn add_trip(&mut self, trip: RawTrip) -> Result<()>
pub fn add_trip(&mut self, trip: RawTrip) -> Result<()>
Add a trip
See https://gtfs.org/schedule/reference/#tripstxt for rules of the individual fields
Note: All entries that the trip refers to already need to exist
Sourcepub fn add_stop_time(&mut self, stop_time: RawStopTime) -> Result<()>
pub fn add_stop_time(&mut self, stop_time: RawStopTime) -> Result<()>
Add a stop time
See https://gtfs.org/schedule/reference/#stoptimestxt for rules of the individual fields
Note: All entries that the trip refers to already need to exist
Sourcepub fn add_service(&mut self, calendar: Calendar) -> Result<()>
pub fn add_service(&mut self, calendar: Calendar) -> Result<()>
Add a calendar entry
See https://gtfs.org/schedule/reference/#calendartxt for rules of the individual fields
Sourcepub fn set_feed_info(&mut self, feed_info: FeedInfo) -> Result<()>
pub fn set_feed_info(&mut self, feed_info: FeedInfo) -> Result<()>
Set the feed info metadata
See https://gtfs.org/schedule/reference/#feedinfotxt for rules of the individual fields
Sourcepub fn write_to<T: AsRef<Path>>(self, path: T) -> Result<()>
pub fn write_to<T: AsRef<Path>>(self, path: T) -> Result<()>
Write the resulting feed to a ZIP file
Before writing, all fields that can be set automatically are set. Currently that is:
- feed_start_date (Set to the first service day in the calendar)
- feed_end_date (Set to the last service day in the calendar)
If the assumptions to not match for your purpose, for example because you include days in the calendar for which the schedule is not yet certain, please set the fields to the correct value before writing.