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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more