Skip to content

Commit

Permalink
add rt recent history
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Sep 17, 2024
1 parent 6f6882f commit da32056
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Empty file added src/aspen/delay_calculation.rs
Empty file.
1 change: 1 addition & 0 deletions src/aspen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::collections::HashMap;
use std::net::IpAddr;
use std::net::SocketAddr;
use tarpc::{client, tokio_serde::formats::Bincode};
pub mod rt_recent_history;

#[derive(serde::Deserialize, Clone, serde::Serialize, Debug)]
pub struct TripsSelectionResponse {
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ use std::hash::Hash;
use std::hash::Hasher;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
pub mod metrolink_ptc_to_stop_id;
pub mod rt_recent_history;

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct ChateauDataNoGeometry {
Expand Down Expand Up @@ -897,3 +898,4 @@ mod test_calendar {
};
}
}

14 changes: 14 additions & 0 deletions src/rt_recent_history/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use crate::aspen_dataset::AspenStopTimeEvent;

pub struct RtKey {
pub trip_id: Option<String>,
pub route_id: Option<String>,
pub direction_id: Option<u32>,
pub start_time_secs: Option<u32>,
pub start_date: Option<chrono::NaiveDate>
}

pub struct RtCacheEntry {
pub last_updated: chrono::DateTime<chrono::Utc>,
pub events: Vec<AspenStopTimeEvent>
}

0 comments on commit da32056

Please sign in to comment.