Expand description
A futures-rs executor design specifically for Fuchsia OS.
§Example:
A simple, singlethreaded print server:
#[fuchsia_async::run_singlethreaded]
async fn main() {
let op = say_world();
// This println! will happen first
println!("Hello...");
// Calling `.await` on `op` starts executing `say_world`.
op.await;
}
async fn say_world() {
println!("...world");
}
Modules§
- A future which can be used by multiple threads at once.
- Implements a combined mutex and condition.
- Asynchronous networking abstractions.
- Structured concurrency API for fuchsia-async.
- Testing support for repeated runs
Macros§
- invoke_for_handle_types!{mmm} calls the macro
mmm!
with two arguments: one is the name of a Zircon handle, the second is one of:
Structs§
- A time relative to the executor’s clock on the boot timeline.
- An I/O object representing a
Channel
. - A handle to an executor.
- An I/O object representing a
Fifo
. - An asynchronous interval timer.
- A handle to a future that is owned and polled by the executor.
- A single-threaded port-based executor for Fuchsia OS.
- A time relative to the executor’s clock.
- A future that completes when some set of signals become available on a Handle.
- A wrapper for a future who’s steady progress is monitored and will complete with the provided closure if no progress is made before the timeout.
- A wrapper for a future which will complete with a provided closure when a timeout occurs.
- A
Handle
that receives notifications when it is readable/writable. - ReadEntries represents the future of a single read with multiple entries.
- ReadOne represents the future of a single read yielding a single entry.
- A registration of a
PacketReceiver
. When dropped, it will automatically deregister thePacketReceiver
. - A future used to receive a message from a channel.
- A scope for managing async tasks. This scope is cancelled when dropped.
- A handle to a scope, which may be used to spawn tasks.
- A multi-threaded port-based executor for Fuchsia OS. Requires that tasks scheduled on it implement
Send
so they can be load balanced between worker threads. - An I/O object representing a
Socket
. - This is the same as a JoinHandle, except that the future will be cancelled when the task is dropped.
- Allows the user to spawn multiple Tasks and await them as a unit.
- A single-threaded executor for testing. Exposes additional APIs for manipulating executor state and validating behavior of executed tasks.
- An asynchronous timer.
- WriteEntries represents the future of one or more writes.
Enums§
- State of an object when it is ready for reading.
- State of an object when it is ready for writing.
Traits§
- An extension trait to provide
after_now
onzx::MonotonicDuration
. - Marker trait for types that can be read/written with a
Fifo
. - Identifies that the object may be used to read entries from a FIFO.
- Identifies that the object may be used to write entries into a FIFO.
- A trait for handling the arrival of a packet on a
zx::Port
. - A
Handle
that receives notifications when it is readable. - A trait which allows futures to be easily wrapped in a timeout.
- The time when a Timer should wakeup.
- A
Handle
that receives notifications when it is writable.
Functions§
- Offload a blocking function call onto a different thread.
Type Aliases§
- A duration on the monotonic timeline.
- Alias for the common case where OnSignals is used with zx::HandleRef.
Attribute Macros§
- Define an
async
function that should run to completion onN
threads. - Define an
async
function that should run to completion on a single thread. - Define an
async
function that should complete without stalling.