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
andinterval_at
. - Timeout
- A future that completes when the inner future completes or when the timeout expires.
Enums§
- Missed
Tick Behavior - Defines the behavior of an
Interval
when it misses a tick.
Traits§
- Make
Delay - A trait for creating delay futures.
- Make
Delay Ext - 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 ofperiod
. The first tick completes immediately. The defaultMissedTickBehavior
isBurst
, but this can be configured by callingset_missed_tick_behavior
. - interval_
at - Creates new
Interval
that yields with interval ofperiod
with the first tick completing atstart
. The defaultMissedTickBehavior
isBurst
, but this can be configured by callingset_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.