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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeSpan
impl RefUnwindSafe for TimeSpan
impl Send for TimeSpan
impl Sync for TimeSpan
impl Unpin for TimeSpan
impl UnwindSafe for TimeSpan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more