First set of commits for realtime support
This commit is contained in:
+3
-1
@@ -2,6 +2,7 @@ mod arrival;
|
||||
mod loader;
|
||||
mod utils;
|
||||
mod refresher;
|
||||
mod realtime;
|
||||
pub mod structs;
|
||||
use chrono::{DateTime, Local, Timelike};
|
||||
use log::{debug, trace};
|
||||
@@ -10,7 +11,7 @@ use gtfs_structures::{Exception, RawTrip};
|
||||
use crate::gtfs::{loader::load_gtfs, structs::{Arrival, Gtfs, Preferences, Error}};
|
||||
|
||||
|
||||
impl Gtfs {
|
||||
impl Gtfs<'_> {
|
||||
|
||||
pub fn get_next_arrivals_for(&self, target_datetime: &DateTime<Local>) -> Option<Vec<Arrival<'_>>> {
|
||||
let naive_target = target_datetime.naive_local();
|
||||
@@ -98,6 +99,7 @@ impl Gtfs {
|
||||
let mut zip_reader = zip::ZipArchive::new(zip_file)?;
|
||||
|
||||
let mut gtfs: Gtfs = Gtfs {
|
||||
preferences: prefs,
|
||||
agencies: Vec::new(),
|
||||
calendar: HashMap::new(),
|
||||
calendar_dates: HashMap::new(),
|
||||
|
||||
Reference in New Issue
Block a user