Module task
Available on crate feature
task only.Macros§
Structs§
- Abort
Handle - An owned permission to abort a spawned task, without awaiting its completion.
- Context
- The context of an asynchronous task.
- Id
- An opaque ID that uniquely identifies a task relative to all other currently running tasks.
- Interval
- Interval returned by
intervalandinterval_at. - Join
Error - Task failed to execute to completion.
- Join
Handle - An owned permission to join on a task (await its termination).
- JoinSet
- A collection of tasks spawned on a Tokio runtime.
- RawWaker
- A
RawWakerallows the implementor of a task executor to create aWakeror aLocalWakerwhich provides customized wakeup behavior. - RawWakerV
Table - A virtual function pointer table (vtable) that specifies the behavior
of a
RawWaker. - Sleep
- Future returned by
sleepandsleep_until. - Timeout
- Future returned by
timeoutandtimeout_at. - Timeout
Elapsed - Errors returned by
Timeout. - Waker
- A
Wakeris a handle for waking up a task by notifying its executor that it is ready to be run.
Enums§
- Missed
Tick Behavior - Defines the behavior of an
Intervalwhen it misses a tick. - Poll
- Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.
Traits§
- Wake
- The implementation of waking a task on an executor.
Functions§
- id
- Returns the
Idof the currently running task. - interval
- Creates new
Intervalthat yields with interval ofperiod. The first tick completes immediately. The defaultMissedTickBehaviorisBurst, but this can be configured by callingset_missed_tick_behavior. - interval_
at - Creates new
Intervalthat yields with interval ofperiodwith the first tick completing atstart. The defaultMissedTickBehaviorisBurst, but this can be configured by callingset_missed_tick_behavior. - sleep
- Waits until
durationhas elapsed. - sleep_
until - Waits until
deadlineis reached. - spawn
- Spawns a new asynchronous task, returning a
JoinHandlefor it. - spawn_
blocking - Runs the provided closure on a thread where blocking is acceptable.
- spawn_
local - Spawns a
!Sendfuture on the currentLocalSetorLocalRuntime. - timeout
- Requires a
Futureto complete before the specified duration has elapsed. - timeout_
at - Requires a
Futureto complete before the specified instant in time. - try_id
- Returns the
Idof the currently running task, orNoneif called outside of a task. - yield_
now - Yields execution back to the Tokio runtime.