Module async_runtime

Module async_runtime 

Source
Expand description

The singleton async runtime used by Tauri and exposed to users.

Tauri uses tokio Runtime to initialize code, such as Plugin::initialize and crate::Builder::setup hooks. This module also re-export some common items most developers need from tokio. If there’s one you need isn’t here, you could use types in tokio directly. For custom command handlers, it’s recommended to use a plain async fn command.

Structs§

Mutex
An asynchronous Mutex-like type.
Receiver
Receives values from the associated Sender.
RwLock
An asynchronous reader-writer lock.
Sender
Sends values to the associated Receiver.
TokioHandle
Handle to the runtime.
TokioJoinHandle
An owned permission to join on a task (await its termination).
TokioRuntime
The Tokio runtime.

Enums§

JoinHandle
An owned permission to join on a task (await its termination).
Runtime
A runtime used to execute asynchronous tasks.
RuntimeHandle
A handle to the async runtime

Functions§

block_on
Runs a future to completion on runtime.
channel
Creates a bounded mpsc channel for communicating between asynchronous tasks with backpressure.
handle
Returns a handle of the async runtime.
set
Sets the runtime to use to execute asynchronous tasks. For convenience, this method takes a TokioHandle. Note that you cannot drop the underlying TokioRuntime.
spawn
Spawns a future onto the runtime.
spawn_blocking
Runs the provided function on an executor dedicated to blocking operations.