pub trait TimePoint:
Debug
+ Clone
+ Copy
+ Eq
+ Ord
+ Neg<Output = Self>
+ Sized {
const INFINITE: Self;
// Required methods
fn is_finite(&self) -> bool;
fn is_future_infinite(&self) -> bool;
fn is_past_infinite(&self) -> bool;
fn just_after(&self) -> Self;
fn just_before(&self) -> Self;
}
Expand description
§A unique point of a time window
Depending of the implementation, it could be relative to
a date (e.g. Timestamp
) or a duration (e.g. TimeValue
).
All the time data are internally represented by a number of ticks. As a consequence, a tick is the most precision that you can get.
In this crate revision, the precision (i.e. the duration of one tick)
is fixed and equals a little bit less that a nanosecond.
It is exactly 1/2^30
seconde.
Required Associated Constants§
Required Methods§
Sourcefn is_future_infinite(&self) -> bool
fn is_future_infinite(&self) -> bool
Checks if this value equals +∞
Sourcefn is_past_infinite(&self) -> bool
fn is_past_infinite(&self) -> bool
Checks if this value equals -∞
Sourcefn just_after(&self) -> Self
fn just_after(&self) -> Self
Returns a value just after this one
Just after means here a point with exactly one tick more; a tick represents the smallest duration which could be represented.
If a time point is infinite (-∞ or +∞), the just after time point does not change and remains infinite.
Sourcefn just_before(&self) -> Self
fn just_before(&self) -> Self
Returns a value just before this one
Just before means here a point with exactly one tick less; a tick represents the smallest duration which could be represented.
If a time point is infinite (-∞ or +∞), the just before time point does not change and remains infinite.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.