Expand description
Tools for working with tasks.
This module contains:
- Spawn, a trait for spawning new tasks.
- Context, a context of an asynchronous task, including a handle for waking up the task.
- Waker, a handle for waking up a task.
The remaining types and traits in the module are used for implementing executors or dealing with synchronization issues around task wakeup.
Re-exports§
- pub use core::task::Context;
- pub use core::task::Poll;
- pub use core::task::RawWaker;
- pub use core::task::RawWakerVTable;
- pub use core::task::Waker;
Structs§
- AtomicWaker 
- A synchronization primitive for task wakeup.
- FutureObj 
- A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + Send + 'a>.
- LocalFuture Obj 
- A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + 'a>.
- SpawnError 
- An error that occurred during spawning.
- WakerRef 
- A Wakerthat is only valid for a given lifetime.
Traits§
- ArcWake
- A way of waking up a specific task.
- LocalSpawn 
- The LocalSpawnis similar toSpawn, but allows spawning futures that don’t implementSend.
- LocalSpawn Ext 
- Extension trait for LocalSpawn.
- Spawn
- The Spawntrait allows for pushing futures onto an executor that will run them to completion.
- SpawnExt 
- Extension trait for Spawn.
- UnsafeFuture Obj 
- A custom implementation of a future trait object for FutureObj, providing a vtable with drop support.
Functions§
- noop_waker 
- Create a new Wakerwhich does nothing whenwake()is called on it.
- noop_waker_ ref 
- Get a static reference to a Wakerwhich does nothing whenwake()is called on it.
- waker
- Creates a Wakerfrom anArc<impl ArcWake>.
- waker_ref 
- Creates a reference to a Wakerfrom a reference toArc<impl ArcWake>.