pub struct TemporalInterval {
pub id: u64,
pub start: i64,
pub end: i64,
pub duration: i64,
}Expand description
Temporal interval with start and end points
Fields§
§id: u64§start: i64§end: i64§duration: i64Implementations§
Source§impl TemporalInterval
impl TemporalInterval
Sourcepub fn overlaps(&self, other: &TemporalInterval) -> bool
pub fn overlaps(&self, other: &TemporalInterval) -> bool
Check if interval overlaps with another
Sourcepub fn intersection(&self, other: &TemporalInterval) -> Option<TemporalInterval>
pub fn intersection(&self, other: &TemporalInterval) -> Option<TemporalInterval>
Get intersection with another interval
Sourcepub fn union(&self, other: &TemporalInterval) -> TemporalInterval
pub fn union(&self, other: &TemporalInterval) -> TemporalInterval
Get union with another interval
Sourcepub fn gap(&self, other: &TemporalInterval) -> Option<i64>
pub fn gap(&self, other: &TemporalInterval) -> Option<i64>
Get gap between intervals
Trait Implementations§
Source§impl Clone for TemporalInterval
impl Clone for TemporalInterval
Source§fn clone(&self) -> TemporalInterval
fn clone(&self) -> TemporalInterval
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemporalInterval
impl Debug for TemporalInterval
Source§impl PartialEq for TemporalInterval
impl PartialEq for TemporalInterval
Source§fn eq(&self, other: &TemporalInterval) -> bool
fn eq(&self, other: &TemporalInterval) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TemporalInterval
impl StructuralPartialEq for TemporalInterval
Auto Trait Implementations§
impl Freeze for TemporalInterval
impl RefUnwindSafe for TemporalInterval
impl Send for TemporalInterval
impl Sync for TemporalInterval
impl Unpin for TemporalInterval
impl UnsafeUnpin for TemporalInterval
impl UnwindSafe for TemporalInterval
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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