Expand description
Represents a time window.
Fields
start: TimestampStart of time window.
end: TimestampEnd of time window.
Implementations
sourceimpl 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
sourceimpl Clone for TimeWindow
impl Clone for TimeWindow
sourcefn clone(&self) -> TimeWindow
fn clone(&self) -> TimeWindow
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for TimeWindow
impl Debug for TimeWindow
sourceimpl Hash for TimeWindow
impl Hash for TimeWindow
sourceimpl PartialEq<TimeWindow> for TimeWindow
impl PartialEq<TimeWindow> for TimeWindow
sourcefn eq(&self, other: &TimeWindow) -> bool
fn eq(&self, other: &TimeWindow) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Eq for TimeWindow
Auto Trait Implementations
impl RefUnwindSafe for TimeWindow
impl Send for TimeWindow
impl Sync for TimeWindow
impl Unpin for TimeWindow
impl UnwindSafe for TimeWindow
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