pub enum TimeSpan {
Window(TimeWindow),
Offset(TimeOffset),
}Expand description
A enum for various time definitions.
Variants
Window(TimeWindow)
A time window variant.
Offset(TimeOffset)
A time offset variant.
Implementations
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TimeSpan
impl Send for TimeSpan
impl Sync for TimeSpan
impl Unpin for TimeSpan
impl UnwindSafe for TimeSpan
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more