pub enum TimeSpan {
Window(TimeWindow),
Offset(TimeOffset),
}Expand description
A enum for various time definitions.
Variants§
Implementations§
source§impl TimeSpan
impl TimeSpan
sourcepub fn to_time_window(&self, date: Timestamp) -> TimeWindow
pub fn to_time_window(&self, date: Timestamp) -> TimeWindow
Converts given time span into time window.
sourcepub fn intersects(&self, date: Timestamp, other: &TimeWindow) -> bool
pub fn intersects(&self, date: Timestamp, other: &TimeWindow) -> bool
Checks that this time span intersects with given time windows.
sourcepub fn as_time_window(&self) -> Option<TimeWindow>
pub fn as_time_window(&self) -> Option<TimeWindow>
If time span is time window, then return it. Otherwise, return None.