pub trait TimeBounds {
    type TimePoint: TimePoint;

    // Required methods
    fn is_empty(&self) -> bool;
    fn is_low_bounded(&self) -> bool;
    fn is_up_bounded(&self) -> bool;
    fn lower_bound(&self) -> Self::TimePoint;
    fn upper_bound(&self) -> Self::TimePoint;

    // Provided methods
    fn is_singleton(&self) -> bool { ... }
    fn is_bounded(&self) -> bool { ... }
}
Expand description

§The envelope (the bounds) of a time window

A trait which describes the envelope of a time window.

Required Associated Types§

source

type TimePoint: TimePoint

The type of the underlying time data.

This is also the type of the element managed by a time window. Typically, the timepoint is Timestamp when dealing with dates and TimeValue when dealing with durations.

Required Methods§

source

fn is_empty(&self) -> bool

Checks if this time window is empty

source

fn is_low_bounded(&self) -> bool

Checks if this time window has a finite lower bound

It returns also false if this time window is empty.

source

fn is_up_bounded(&self) -> bool

Checks if this time window has a finite upper bound

It returns also false if this time window is empty.

source

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

The lower bound of the time window

The behavior is undefined if the time window is empty

source

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

The upper bound of the time window

The behavior is undefined if the time window is empty

Provided Methods§

source

fn is_singleton(&self) -> bool

Checks if this time window contains exactly one value

A singleton is not empty and its lower bound equals its upper bound.

source

fn is_bounded(&self) -> bool

Checks if this time window is bounded

It returns also false if this time window is empty.

Implementations on Foreign Types§

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<TW> TimeBounds for ((Instant, Instant), TW)
where TW: TimeBounds<TimePoint = TimeValue>,

Implementors§