pub struct Clock {}Expand description
The system clock
Implementations§
Source§impl Clock
impl Clock
Sourcepub fn current_time_rounded_to_seconds() -> Instant
pub fn current_time_rounded_to_seconds() -> Instant
Returns the current timestamp (in seconds)
Sourcepub fn current_time_rounded_to_minutes() -> Instant
pub fn current_time_rounded_to_minutes() -> Instant
Returns the current timestamp (in seconds), rounded down to minutes
Sourcepub fn current_time(precision: TimePrecision) -> Instant
pub fn current_time(precision: TimePrecision) -> Instant
Returns the current timestamp (in seconds), rounded down to the specified precision
Sourcepub fn current_time_is_strictly_before(
instant: Instant,
precision: TimePrecision,
) -> bool
pub fn current_time_is_strictly_before( instant: Instant, precision: TimePrecision, ) -> bool
Returns true if current time, rounded down to a given precision, is strictly before the specified instant (also rounded down to a given precision), false otherwise.
Sourcepub fn current_time_is_at_or_before(
instant: Instant,
precision: TimePrecision,
) -> bool
pub fn current_time_is_at_or_before( instant: Instant, precision: TimePrecision, ) -> bool
Returns true if current time, rounded down to a given precision, is before or equal to the specified instant (also rounded down to a given precision), false otherwise.
Sourcepub fn current_time_is_strictly_after(
instant: Instant,
precision: TimePrecision,
) -> bool
pub fn current_time_is_strictly_after( instant: Instant, precision: TimePrecision, ) -> bool
Returns true if current time, rounded down to a given precision, is strictly after the specified instant (also rounded down to a given precision), false otherwise.
Sourcepub fn current_time_is_at_or_after(
instant: Instant,
precision: TimePrecision,
) -> bool
pub fn current_time_is_at_or_after( instant: Instant, precision: TimePrecision, ) -> bool
Returns true if current time, rounded down to a given precision, is after or equal to the specified instant (also rounded down to a given precision), false otherwise.
Sourcepub fn current_time_comparison(
instant: Instant,
precision: TimePrecision,
operator: TimeComparisonOperator,
) -> bool
pub fn current_time_comparison( instant: Instant, precision: TimePrecision, operator: TimeComparisonOperator, ) -> bool
Returns true if current time, rounded down to a given precision, matches the given comparison operator against the specified instant (also rounded down to a given precision), false otherwise.