Crate fastimer

Source
Expand description

Fastimer implements runtime-agnostic timer traits and utilities.

§Scheduled Actions

Fastimer provides scheduled actions that can be scheduled as a repeating and cancellable action.

  • SimpleAction: A simple repeatable action that can be scheduled with a fixed delay, or at a fixed rate.
  • ArbitraryDelayAction: A repeatable action that can be scheduled with arbitrary delay.
  • NotifyAction: A repeatable action that can be scheduled by notifications.

§Timeout

Timeout is a future combinator that completes when the inner future completes or when the timeout expires.

§Interval

Interval ticks at a sequence of instants with a certain duration between each instant.

Modules§

schedule
Repeatable and cancellable actions.

Structs§

Elapsed
Errors returned by Timeout.
Interval
Interval returned by interval and interval_at.
Timeout
A future that completes when the inner future completes or when the timeout expires.

Enums§

MissedTickBehavior
Defines the behavior of an Interval when it misses a tick.

Traits§

MakeDelay
A trait for creating delay futures.
MakeDelayExt
Provides extension methods for MakeDelay implementors.
Spawn
A trait for spawning futures.

Functions§

far_future
Create a far future instant.
interval
Creates new Interval that yields with interval of period. The first tick completes immediately. The default MissedTickBehavior is Burst, but this can be configured by calling set_missed_tick_behavior.
interval_at
Creates new Interval that yields with interval of period with the first tick completing at start. The default MissedTickBehavior is Burst, but this can be configured by calling set_missed_tick_behavior.
make_instant_from
Create an instant from the given instant and a duration.
make_instant_from_now
Create an instant from Instant::now and a duration.
timeout
Requires a Future to complete before the specified duration has elapsed.
timeout_at
Requires a Future to complete before the specified instant in time.