pub struct TimeSet<T: TimePoint>(/* private fields */);
Expand description
§A union of time intervals
This is the more generic structure to keep a set of time points. It could be empty, convex or defined by pieces.
The inner list of time intervals is chronological sorted and all the inner intervals are disjoint. If, when added, two intervals overlaps, then they are merged.
Implementations§
Source§impl<T: TimePoint> TimeSet<T>
impl<T: TimePoint> TimeSet<T>
Sourcepub fn all() -> Self
pub fn all() -> Self
The full interval ]-oo,+oo[
Returns a timeset composed of the full interval ]-oo,+oo[
Sourcepub fn convex(lower: T, upper: T) -> Self
pub fn convex(lower: T, upper: T) -> Self
A convex interval [a,b]
Returns a timeset composed of one convex interval.
Sourcepub fn singleton(t: T) -> Self
pub fn singleton(t: T) -> Self
A singleton {t}
Retuns a timeset composed of the convex interval [t,t]
pub fn shrink_to_fit(&mut self)
Trait Implementations§
Source§impl<T> Add<TimeSet<TimeValue>> for TimeSet<T>where
T: TimePoint + Add<TimeValue, Output = T>,
TimeInterval<T>: Add<TimeInterval<TimeValue>, Output = TimeInterval<T>>,
Self: BitOr<TimeInterval<T>, Output = Self> + TimeBounds<TimePoint = T>,
impl<T> Add<TimeSet<TimeValue>> for TimeSet<T>where
T: TimePoint + Add<TimeValue, Output = T>,
TimeInterval<T>: Add<TimeInterval<TimeValue>, Output = TimeInterval<T>>,
Self: BitOr<TimeInterval<T>, Output = Self> + TimeBounds<TimePoint = T>,
Source§impl<T> AddAssign<TimeInterval<TimeValue>> for TimeSet<T>
impl<T> AddAssign<TimeInterval<TimeValue>> for TimeSet<T>
Source§fn add_assign(&mut self, other: TimeSpan)
fn add_assign(&mut self, other: TimeSpan)
Performs the
+=
operation. Read moreSource§impl<T> AddAssign<TimeSet<TimeValue>> for TimeSet<T>
impl<T> AddAssign<TimeSet<TimeValue>> for TimeSet<T>
Source§fn add_assign(&mut self, other: TimeSpans)
fn add_assign(&mut self, other: TimeSpans)
Performs the
+=
operation. Read moreSource§impl<T: TimePoint> AddAssign<TimeValue> for TimeSet<T>
impl<T: TimePoint> AddAssign<TimeValue> for TimeSet<T>
Source§fn add_assign(&mut self, t: TimeValue)
fn add_assign(&mut self, t: TimeValue)
Performs the
+=
operation. Read moreSource§impl<T: TimePoint> BitAndAssign<&TimeSet<T>> for TimeSet<T>
impl<T: TimePoint> BitAndAssign<&TimeSet<T>> for TimeSet<T>
Source§fn bitand_assign(&mut self, tw: &Self)
fn bitand_assign(&mut self, tw: &Self)
Performs the
&=
operation. Read moreSource§impl<T: TimePoint, TW> BitAndAssign<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitAndAssign<TW> for TimeSet<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> BitAndAssign for TimeSet<T>
impl<T: TimePoint> BitAndAssign for TimeSet<T>
Source§fn bitand_assign(&mut self, tw: Self)
fn bitand_assign(&mut self, tw: Self)
Performs the
&=
operation. Read moreSource§impl<T: TimePoint> BitOrAssign<&TimeSet<T>> for TimeSet<T>
impl<T: TimePoint> BitOrAssign<&TimeSet<T>> for TimeSet<T>
Source§fn bitor_assign(&mut self, tw: &Self)
fn bitor_assign(&mut self, tw: &Self)
Performs the
|=
operation. Read moreSource§impl<T: TimePoint, TW> BitOrAssign<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> BitOrAssign<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
Source§fn bitor_assign(&mut self, tw: TW)
fn bitor_assign(&mut self, tw: TW)
Performs the
|=
operation. Read moreSource§impl<T: TimePoint> BitOrAssign for TimeSet<T>
impl<T: TimePoint> BitOrAssign for TimeSet<T>
Source§fn bitor_assign(&mut self, tw: Self)
fn bitor_assign(&mut self, tw: Self)
Performs the
|=
operation. Read moreSource§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<'a, T: TimePoint> IntoIterator for &'a TimeSet<T>
impl<'a, T: TimePoint> IntoIterator for &'a TimeSet<T>
Source§impl<T: TimePoint> IntoIterator for TimeSet<T>
impl<T: TimePoint> IntoIterator for TimeSet<T>
Source§impl<T: TimePoint, TW> PartialOrd<TW> for TimeSet<T>where
TW: TimeWindow<TimePoint = T>,
impl<T: TimePoint, TW> PartialOrd<TW> for TimeSet<T>where
TW: TimeWindow<TimePoint = T>,
Source§impl<T> Sub<TimeSet<TimeValue>> for TimeSet<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
TimeInterval<T>: Sub<TimeInterval<TimeValue>, Output = TimeInterval<T>>,
Self: BitOr<TimeInterval<T>, Output = Self> + TimeBounds<TimePoint = T>,
impl<T> Sub<TimeSet<TimeValue>> for TimeSet<T>where
T: TimePoint + Sub<TimeValue, Output = T>,
TimeInterval<T>: Sub<TimeInterval<TimeValue>, Output = TimeInterval<T>>,
Self: BitOr<TimeInterval<T>, Output = Self> + TimeBounds<TimePoint = T>,
Source§impl<T> SubAssign<TimeInterval<TimeValue>> for TimeSet<T>
impl<T> SubAssign<TimeInterval<TimeValue>> for TimeSet<T>
Source§fn sub_assign(&mut self, other: TimeSpan)
fn sub_assign(&mut self, other: TimeSpan)
Performs the
-=
operation. Read moreSource§impl<T> SubAssign<TimeSet<TimeValue>> for TimeSet<T>
impl<T> SubAssign<TimeSet<TimeValue>> for TimeSet<T>
Source§fn sub_assign(&mut self, other: TimeSpans)
fn sub_assign(&mut self, other: TimeSpans)
Performs the
-=
operation. Read moreSource§impl<T: TimePoint> SubAssign<TimeValue> for TimeSet<T>
impl<T: TimePoint> SubAssign<TimeValue> for TimeSet<T>
Source§fn sub_assign(&mut self, t: TimeValue)
fn sub_assign(&mut self, t: TimeValue)
Performs the
-=
operation. Read moreSource§impl<T: TimePoint> TimeBounds for TimeSet<T>
impl<T: TimePoint> TimeBounds for TimeSet<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
Source§impl<T: TimePoint, TW> TimeContaining<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> TimeContaining<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
Source§impl<T: TimePoint, TW> TimeOverlapping<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
impl<T: TimePoint, TW> TimeOverlapping<TW> for TimeSet<T>where
TW: TimeConvex<TimePoint = T>,
Source§impl<T: TimePoint> TimeTruncation for TimeSet<T>
impl<T: TimePoint> TimeTruncation for TimeSet<T>
Source§fn truncate_before(&mut self, lower: T) -> bool
fn truncate_before(&mut self, lower: T) -> bool
Returns true
if something changed
Source§fn truncate_after(&mut self, upper: T) -> bool
fn truncate_after(&mut self, upper: T) -> bool
Returns true
if something changed
Source§impl<T: TimePoint> TimeWindow for TimeSet<T>
impl<T: TimePoint> TimeWindow for TimeSet<T>
type ConvexIter = IntoConvexIter<T, IntoIter<TimeInterval<T>>>
Source§fn convex_count(&self) -> usize
fn convex_count(&self) -> usize
The number of convex parts Read more
fn iter(&self) -> Self::ConvexIter
fn is_all(&self) -> bool
Source§fn convex_envelope(&self) -> TimeInterval<Self::TimePoint>
fn convex_envelope(&self) -> TimeInterval<Self::TimePoint>
Convex envelope of the time window Read more
impl<T: Eq + TimePoint> Eq for TimeSet<T>
Auto Trait Implementations§
impl<T> Freeze for TimeSet<T>
impl<T> RefUnwindSafe for TimeSet<T>where
T: RefUnwindSafe,
impl<T> Send for TimeSet<T>where
T: Send,
impl<T> Sync for TimeSet<T>where
T: Sync,
impl<T> Unpin for TimeSet<T>where
T: Unpin,
impl<T> UnwindSafe for TimeSet<T>where
T: UnwindSafe,
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