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
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
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