pub enum Schedule {
FixedHeadway {
headway: f64,
first: f64,
},
Timetable(Vec<Departure>),
}Expand description
Departure pattern for a route.
Variants§
FixedHeadway
Regular interval (seconds between successive departures).
Fields
Timetable(Vec<Departure>)
Explicit timetable.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn fixed_headway(headway: f64) -> Self
pub fn fixed_headway(headway: f64) -> Self
Fixed headway starting at t = 0.
Sourcepub fn fixed_headway_starting(headway: f64, first: f64) -> Self
pub fn fixed_headway_starting(headway: f64, first: f64) -> Self
Fixed headway starting at t = first.
Sourcepub fn next_departure(&self, now: f64) -> Option<Departure>
pub fn next_departure(&self, now: f64) -> Option<Departure>
Returns the next scheduled departure time ≥ now.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
impl UnwindSafe for Schedule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more