pub struct Interval<T> { /* private fields */ }Expand description
A half-open interval [start, end).
Implementations§
Source§impl<T> Interval<T>
impl<T> Interval<T>
Sourcepub fn is_empty(&self) -> boolwhere
T: Ord,
pub fn is_empty(&self) -> boolwhere
T: Ord,
Returns true if the interval is empty (start >= end).
Sourcepub fn contains_time(&self, time: T) -> boolwhere
T: Ord,
pub fn contains_time(&self, time: T) -> boolwhere
T: Ord,
Returns true if time falls within [start, end).
Sourcepub fn step_by(&self, step: TimeDelta) -> IntervalStepIter<T> ⓘ
pub fn step_by(&self, step: TimeDelta) -> IntervalStepIter<T> ⓘ
Returns an iterator of evenly-spaced points from start to end (inclusive) with the given step size.
The step sign is automatically adjusted to match the interval direction:
forward if start <= end, backward if start > end.
§Panics
Panics if step is zero.
Source§impl Interval<TimeDelta>
impl Interval<TimeDelta>
Sourcepub fn to_scale<T: TimeScale + Copy>(&self, scale: T) -> TimeInterval<T>
pub fn to_scale<T: TimeScale + Copy>(&self, scale: T) -> TimeInterval<T>
Converts this delta-based interval to a TimeInterval in the given time scale.
Source§impl<T> Interval<Time<T>>
impl<T> Interval<Time<T>>
Sourcepub fn to_utc(&self) -> UtcInterval
pub fn to_utc(&self) -> UtcInterval
Converts this time interval to a UtcInterval.
Source§impl Interval<Utc>
impl Interval<Utc>
Sourcepub fn to_time(&self) -> TimeInterval<Tai>
pub fn to_time(&self) -> TimeInterval<Tai>
Converts this UTC interval to a TimeInterval in TAI.
Trait Implementations§
impl<T: Copy> Copy for Interval<T>
impl<T: Eq> Eq for Interval<T>
impl<T> StructuralPartialEq for Interval<T>
Auto Trait Implementations§
impl<T> Freeze for Interval<T>where
T: Freeze,
impl<T> RefUnwindSafe for Interval<T>where
T: RefUnwindSafe,
impl<T> Send for Interval<T>where
T: Send,
impl<T> Sync for Interval<T>where
T: Sync,
impl<T> Unpin for Interval<T>where
T: Unpin,
impl<T> UnsafeUnpin for Interval<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Interval<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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