Struct vrp_core::models::common::TimeWindow
source · Expand description
Represents a time window.
Fields§
§start: TimestampStart of time window.
end: TimestampEnd of time window.
Implementations§
source§impl TimeWindow
impl TimeWindow
sourcepub fn new(start: Timestamp, end: Timestamp) -> Self
pub fn new(start: Timestamp, end: Timestamp) -> Self
Creates a new TimeWindow.
sourcepub fn intersects(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Checks whether time window has intersection with another one (inclusive).
sourcepub fn contains(&self, time: Timestamp) -> bool
pub fn contains(&self, time: Timestamp) -> bool
Checks whether time window contains given time.
sourcepub fn overlapping(&self, other: &Self) -> Option<TimeWindow>
pub fn overlapping(&self, other: &Self) -> Option<TimeWindow>
Returns a new overlapping time window.
Trait Implementations§
source§impl Clone for TimeWindow
impl Clone for TimeWindow
source§fn clone(&self) -> TimeWindow
fn clone(&self) -> TimeWindow
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more