Struct TimeSet

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

Source

pub fn all() -> Self

The full interval ]-oo,+oo[

Returns a timeset composed of the full interval ]-oo,+oo[

Source

pub fn convex(lower: T, upper: T) -> Self

A convex interval [a,b]

Returns a timeset composed of one convex interval.

Source

pub fn singleton(t: T) -> Self

A singleton {t}

Retuns a timeset composed of the convex interval [t,t]

Source

pub fn empty() -> Self

The empty set

Source

pub fn shrink_to_fit(&mut self)

Trait Implementations§

Source§

impl<T> Add<TimeInterval<TimeValue>> for TimeSet<T>
where T: TimePoint + Add<TimeValue, Output = T>, Self: BitOr<TimeInterval<T>, Output = Self>,

Source§

type Output = TimeSet<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeSpan) -> Self::Output

Performs the + operation. Read more
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>,

Source§

type Output = TimeSet<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeSpans) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<TimeSet<TimeValue>> for Timestamp

Source§

type Output = TimeSet<Timestamp>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeSpans) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: TimePoint> Add<TimeValue> for TimeSet<T>
where TimeInterval<T>: Add<TimeValue, Output = TimeInterval<T>>,

Source§

type Output = TimeSet<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeValue) -> Self::Output

Performs the + operation. Read more
Source§

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)

Performs the += operation. Read more
Source§

impl<T> AddAssign<TimeSet<TimeValue>> for TimeSet<T>
where T: TimePoint + Add<TimeValue, Output = T>, Self: Add<TimeSpans, Output = Self>,

Source§

fn add_assign(&mut self, other: TimeSpans)

Performs the += operation. Read more
Source§

impl<T: TimePoint> AddAssign<TimeValue> for TimeSet<T>

Source§

fn add_assign(&mut self, t: TimeValue)

Performs the += operation. Read more
Source§

impl<T: TimePoint> BitAnd<&TimeSet<T>> for TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: &Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: TimePoint, TW> BitAnd<TW> for &TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

type Output = TimeSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: TW) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: TimePoint, TW> BitAnd<TW> for TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

type Output = TimeSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: TW) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: TimePoint> BitAnd<TimeSet<T>> for &TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: TimeSet<T>) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: TimePoint> BitAnd for &TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: &TimeSet<T>) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: TimePoint> BitAnd for TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: TimePoint> BitAndAssign<&TimeSet<T>> for TimeSet<T>

Source§

fn bitand_assign(&mut self, tw: &Self)

Performs the &= operation. Read more
Source§

impl<T: TimePoint, TW> BitAndAssign<TW> for TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

fn bitand_assign(&mut self, tw: TW)

Performs the &= operation. Read more
Source§

impl<T: TimePoint> BitAndAssign for TimeSet<T>

Source§

fn bitand_assign(&mut self, tw: Self)

Performs the &= operation. Read more
Source§

impl<T: TimePoint> BitOr<&TimeSet<T>> for TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: &Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: TimePoint, TW> BitOr<TW> for &TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

type Output = TimeSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: TW) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: TimePoint, TW> BitOr<TW> for TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

type Output = TimeSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: TW) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: TimePoint> BitOr<TimeSet<T>> for &TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: TimeSet<T>) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: TimePoint> BitOr for &TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: &TimeSet<T>) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: TimePoint> BitOr for TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: TimePoint> BitOrAssign<&TimeSet<T>> for TimeSet<T>

Source§

fn bitor_assign(&mut self, tw: &Self)

Performs the |= operation. Read more
Source§

impl<T: TimePoint, TW> BitOrAssign<TW> for TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

fn bitor_assign(&mut self, tw: TW)

Performs the |= operation. Read more
Source§

impl<T: TimePoint> BitOrAssign for TimeSet<T>

Source§

fn bitor_assign(&mut self, tw: Self)

Performs the |= operation. Read more
Source§

impl<T: Clone + TimePoint> Clone for TimeSet<T>

Source§

fn clone(&self) -> TimeSet<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: TimePoint + Debug> Debug for TimeSet<T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: TimePoint + Display> Display for TimeSet<T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, TW> From<TW> for TimeSet<T>
where T: TimePoint, TW: TimeConvex<TimePoint = T>,

Source§

fn from(tw: TW) -> Self

Converts to this type from the input type.
Source§

impl<T: TimePoint> FromIterator<TimeInterval<T>> for TimeSet<T>

Source§

fn from_iter<I: IntoIterator<Item = TimeInterval<T>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T: TimePoint> FromIterator<TimeSet<T>> for TimeSet<T>

Source§

fn from_iter<I: IntoIterator<Item = TimeSet<T>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T: Hash + TimePoint> Hash for TimeSet<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, T: TimePoint> IntoIterator for &'a TimeSet<T>

Source§

type Item = TimeInterval<T>

The type of the elements being iterated over.
Source§

type IntoIter = IntoConvexIter<T, Copied<Iter<'a, TimeInterval<T>>>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: TimePoint> IntoIterator for TimeSet<T>

Source§

type Item = TimeInterval<T>

The type of the elements being iterated over.
Source§

type IntoIter = IntoConvexIter<T, IntoIter<<TimeSet<T> as IntoIterator>::Item>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Mul<TimeSet<TimeValue>> for f32

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for f64

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for i128

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for i16

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for i32

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for i64

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for i8

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for isize

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for u128

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for u16

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for u32

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for u64

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for u8

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeSet<TimeValue>> for usize

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeSpans) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: TimePoint> Neg for TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<T: TimePoint> Not for TimeSet<T>

Source§

type Output = TimeSet<T>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<T: TimePoint, TW> PartialEq<TW> for TimeSet<T>
where TW: TimeWindow<TimePoint = T>,

Source§

fn eq(&self, other: &TW) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: TimePoint, TW> PartialOrd<TW> for TimeSet<T>
where TW: TimeWindow<TimePoint = T>,

Source§

fn partial_cmp(&self, other: &TW) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
Source§

fn lt(&self, other: &TW) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
Source§

fn le(&self, other: &TW) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
Source§

fn gt(&self, other: &TW) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
Source§

fn ge(&self, other: &TW) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Sub<TimeInterval<TimeValue>> for TimeSet<T>
where T: TimePoint + Sub<TimeValue, Output = T>, Self: BitOr<TimeInterval<T>, Output = Self>,

Source§

type Output = TimeSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeSpan) -> Self::Output

Performs the - operation. Read more
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>,

Source§

type Output = TimeSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeSpans) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<TimeSet<TimeValue>> for Timestamp

Source§

type Output = TimeSet<Timestamp>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeSpans) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: TimePoint> Sub<TimeValue> for TimeSet<T>
where TimeInterval<T>: Sub<TimeValue, Output = TimeInterval<T>>,

Source§

type Output = TimeSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeValue) -> Self::Output

Performs the - operation. Read more
Source§

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)

Performs the -= operation. Read more
Source§

impl<T> SubAssign<TimeSet<TimeValue>> for TimeSet<T>
where T: TimePoint + Sub<TimeValue, Output = T>, Self: Sub<TimeSpans, Output = Self>,

Source§

fn sub_assign(&mut self, other: TimeSpans)

Performs the -= operation. Read more
Source§

impl<T: TimePoint> SubAssign<TimeValue> for TimeSet<T>

Source§

fn sub_assign(&mut self, t: TimeValue)

Performs the -= operation. Read more
Source§

impl<T: TimePoint> TimeBounds for TimeSet<T>

Source§

type TimePoint = T

The type of the underlying time data. Read more
Source§

fn is_empty(&self) -> bool

Checks if this time window is empty
Source§

fn is_singleton(&self) -> bool

Checks if this time window contains exactly one value Read more
Source§

fn is_bounded(&self) -> bool

Checks if this time window is bounded Read more
Source§

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

Checks if this time window has a finite upper bound Read more
Source§

fn lower_bound(&self) -> Self::TimePoint

The lower bound of the time window Read more
Source§

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

Source§

fn contains(&self, rhs: &TW) -> bool

Source§

impl<T: TimePoint> TimeContaining<TimeSet<T>> for TimeSet<T>

Source§

fn contains(&self, rhs: &Self) -> bool

Source§

impl<T: TimePoint, TW> TimeOverlapping<TW> for TimeSet<T>
where TW: TimeConvex<TimePoint = T>,

Source§

fn overlaps(&self, rhs: &TW) -> bool

Source§

impl<T: TimePoint> TimeOverlapping<TimeSet<T>> for TimeSet<T>

Source§

fn overlaps(&self, rhs: &Self) -> bool

Source§

impl<T: TimePoint> TimeTruncation for TimeSet<T>

Source§

fn truncate_before(&mut self, lower: T) -> bool

Returns true if something changed

Source§

fn truncate_after(&mut self, upper: T) -> bool

Returns true if something changed

Source§

impl<T: TimePoint> TimeWindow for TimeSet<T>

Source§

type ConvexIter = IntoConvexIter<T, IntoIter<TimeInterval<T>>>

Source§

fn convex_count(&self) -> usize

The number of convex parts Read more
Source§

fn iter(&self) -> Self::ConvexIter

Source§

fn is_all(&self) -> bool

Source§

fn is_convex(&self) -> bool

Checks if this time window is an interval Read more
Source§

fn convex_envelope(&self) -> TimeInterval<Self::TimePoint>

Convex envelope of the time window Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<TW> TimeIntersection<&TimeSet<<TW as TimeConvexIterator>::TimePoint>> for TW

Source§

impl<TW> TimeIntersection<TimeSet<<TW as TimeConvexIterator>::TimePoint>> for TW

Source§

impl<TW> TimeOverlapping<TimeSet<<TW as TimeBounds>::TimePoint>> for TW
where TW: TimeConvex,

Source§

fn overlaps(&self, rhs: &TimeSet<<TW as TimeBounds>::TimePoint>) -> bool

Source§

impl<TW> TimeUnion<&TimeSet<<TW as TimeConvexIterator>::TimePoint>> for TW

Source§

impl<TW> TimeUnion<TimeSet<<TW as TimeConvexIterator>::TimePoint>> for TW

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.