Struct chronologic::TimeInterval
source · pub struct TimeInterval<T: TimePoint> { /* private fields */ }Expand description
Implementations§
source§impl<T: TimePoint> TimeInterval<T>
impl<T: TimePoint> TimeInterval<T>
sourcepub fn new(lower: T, upper: T) -> Self
pub fn new(lower: T, upper: T) -> Self
Interval is empty if the first bound is greater than the second one.
pub fn empty() -> Self
sourcepub fn truncate_before(&mut self, lower: T) -> bool
pub fn truncate_before(&mut self, lower: T) -> bool
Returns true if something changed
sourcepub fn truncate_after(&mut self, upper: T) -> bool
pub fn truncate_after(&mut self, upper: T) -> bool
Returns true if something changed
Trait Implementations§
source§impl<T> Add<TimeInterval<T>> for TimeValuewhere
T: TimePoint + Add<TimeValue, Output = T>,
impl<T> Add<TimeInterval<T>> for TimeValuewhere
T: TimePoint + Add<TimeValue, Output = T>,
§type Output = TimeInterval<T>
type Output = TimeInterval<T>
The resulting type after applying the
+ operator.source§impl<T> Add<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + Add<TimeValue, Output = T>,
impl<T> Add<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + Add<TimeValue, Output = T>,
source§impl<T> Add<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Add<TimeValue, Output = T>,
Self: BitOr<TimeInterval<T>, Output = Self>,
impl<T> Add<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Add<TimeValue, Output = T>,
Self: BitOr<TimeInterval<T>, Output = Self>,
source§impl<T> AddAssign<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + AddAssign<TimeValue>,
impl<T> AddAssign<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + AddAssign<TimeValue>,
source§fn add_assign(&mut self, other: TimeSpan)
fn add_assign(&mut self, other: TimeSpan)
Performs the
+= operation. Read moresource§impl<T> AddAssign<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Add<TimeValue, Output = T>,
Self: Add<TimeSpan, Output = Self>,
impl<T> AddAssign<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Add<TimeValue, Output = T>,
Self: Add<TimeSpan, Output = Self>,
source§fn add_assign(&mut self, other: TimeSpan)
fn add_assign(&mut self, other: TimeSpan)
Performs the
+= operation. Read moresource§impl<T> AddAssign<TimeValue> for TimeInterval<T>where
T: TimePoint + AddAssign<TimeValue>,
impl<T> AddAssign<TimeValue> for TimeInterval<T>where
T: TimePoint + AddAssign<TimeValue>,
source§fn add_assign(&mut self, other: TimeValue)
fn add_assign(&mut self, other: TimeValue)
Performs the
+= operation. Read moresource§impl<T: TimePoint, TW> BitAnd<TW> for &TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitAnd<TW> for &TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
source§impl<T: TimePoint, TW> BitAnd<TW> for TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitAnd<TW> for TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
source§impl<T: TimePoint, TW> BitAndAssign<TW> for TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitAndAssign<TW> for TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
source§fn bitand_assign(&mut self, tw: TW)
fn bitand_assign(&mut self, tw: TW)
Performs the
&= operation. Read moresource§impl<T: TimePoint, TW> BitOr<TW> for &TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitOr<TW> for &TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
source§impl<T: TimePoint, TW> BitOr<TW> for TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitOr<TW> for TimeInterval<T>where
TW: TimeConvex<TimePoint = T>,
source§impl<T: Clone + TimePoint> Clone for TimeInterval<T>
impl<T: Clone + TimePoint> Clone for TimeInterval<T>
source§fn clone(&self) -> TimeInterval<T>
fn clone(&self) -> TimeInterval<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<T: TimePoint> Default for TimeInterval<T>
impl<T: TimePoint> Default for TimeInterval<T>
source§impl<T: TimePoint> From<RangeInclusive<T>> for TimeInterval<T>
impl<T: TimePoint> From<RangeInclusive<T>> for TimeInterval<T>
source§fn from(range: RangeInclusive<T>) -> Self
fn from(range: RangeInclusive<T>) -> Self
Converts to this type from the input type.
source§impl<T: TimePoint> From<RangeToInclusive<T>> for TimeInterval<T>
impl<T: TimePoint> From<RangeToInclusive<T>> for TimeInterval<T>
source§fn from(range: RangeToInclusive<T>) -> Self
fn from(range: RangeToInclusive<T>) -> Self
Converts to this type from the input type.
source§impl<T: TimePoint> From<T> for TimeInterval<T>
impl<T: TimePoint> From<T> for TimeInterval<T>
source§impl<T: TimePoint> FromIterator<TimeInterval<T>> for TimeSet<T>
impl<T: TimePoint> FromIterator<TimeInterval<T>> for TimeSet<T>
source§fn from_iter<I: IntoIterator<Item = TimeInterval<T>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = TimeInterval<T>>>(iter: I) -> Self
Creates a value from an iterator. Read more
source§impl<T: TimePoint> IntoIterator for TimeInterval<T>
impl<T: TimePoint> IntoIterator for TimeInterval<T>
§type Item = TimeInterval<T>
type Item = TimeInterval<T>
The type of the elements being iterated over.
§type IntoIter = IntoIter<<TimeInterval<T> as IntoIterator>::Item>
type IntoIter = IntoIter<<TimeInterval<T> as IntoIterator>::Item>
Which kind of iterator are we turning this into?
source§impl<T: TimePoint> Neg for TimeInterval<T>
impl<T: TimePoint> Neg for TimeInterval<T>
source§impl<T: TimePoint> Not for TimeInterval<T>
impl<T: TimePoint> Not for TimeInterval<T>
source§impl<T: TimePoint, TW> PartialEq<TW> for TimeInterval<T>where
TW: TimeWindow<TimePoint = T>,
impl<T: TimePoint, TW> PartialEq<TW> for TimeInterval<T>where
TW: TimeWindow<TimePoint = T>,
source§impl<T: TimePoint, TW> PartialOrd<TW> for TimeInterval<T>where
TW: TimeWindow<TimePoint = T>,
impl<T: TimePoint, TW> PartialOrd<TW> for TimeInterval<T>where
TW: TimeWindow<TimePoint = T>,
source§impl<T> Sub<TimeInterval<T>> for TimeValuewhere
T: TimePoint + Add<TimeValue, Output = T>,
impl<T> Sub<TimeInterval<T>> for TimeValuewhere
T: TimePoint + Add<TimeValue, Output = T>,
§type Output = TimeInterval<T>
type Output = TimeInterval<T>
The resulting type after applying the
- operator.source§impl<T> Sub<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
impl<T> Sub<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
source§impl<T> Sub<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
Self: BitOr<TimeInterval<T>, Output = Self>,
impl<T> Sub<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
Self: BitOr<TimeInterval<T>, Output = Self>,
source§impl<T> SubAssign<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + SubAssign<TimeValue>,
impl<T> SubAssign<TimeInterval<TimeValue>> for TimeInterval<T>where
T: TimePoint + SubAssign<TimeValue>,
source§fn sub_assign(&mut self, other: TimeSpan)
fn sub_assign(&mut self, other: TimeSpan)
Performs the
-= operation. Read moresource§impl<T> SubAssign<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
Self: Sub<TimeSpan, Output = Self>,
impl<T> SubAssign<TimeInterval<TimeValue>> for TimeSet<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
Self: Sub<TimeSpan, Output = Self>,
source§fn sub_assign(&mut self, other: TimeSpan)
fn sub_assign(&mut self, other: TimeSpan)
Performs the
-= operation. Read moresource§impl<T> SubAssign<TimeValue> for TimeInterval<T>where
T: TimePoint + SubAssign<TimeValue>,
impl<T> SubAssign<TimeValue> for TimeInterval<T>where
T: TimePoint + SubAssign<TimeValue>,
source§fn sub_assign(&mut self, other: TimeValue)
fn sub_assign(&mut self, other: TimeValue)
Performs the
-= operation. Read moresource§impl<T: TimePoint> TimeBounds for TimeInterval<T>
impl<T: TimePoint> TimeBounds for TimeInterval<T>
source§fn is_singleton(&self) -> bool
fn is_singleton(&self) -> bool
Checks if this time window contains exactly one value Read more
source§fn is_bounded(&self) -> bool
fn is_bounded(&self) -> bool
Checks if this time window is bounded Read more
source§fn is_low_bounded(&self) -> bool
fn is_low_bounded(&self) -> bool
Checks if this time window has a finite lower bound Read more
source§fn is_up_bounded(&self) -> bool
fn is_up_bounded(&self) -> bool
Checks if this time window has a finite upper bound Read more
source§fn lower_bound(&self) -> Self::TimePoint
fn lower_bound(&self) -> Self::TimePoint
The lower bound of the time window Read more
source§fn upper_bound(&self) -> Self::TimePoint
fn upper_bound(&self) -> Self::TimePoint
The upper bound of the time window Read more