First set of commits for realtime support

This commit is contained in:
2026-06-06 19:02:02 +01:00
parent cba2b17f57
commit 40f8c46d80
3 changed files with 43 additions and 2 deletions
+3 -1
View File
@@ -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(),