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
. - Tokio
Handle - Handle to the runtime.
- Tokio
Join Handle - An owned permission to join on a task (await its termination).
- Tokio
Runtime - The Tokio runtime.
Enums§
- Join
Handle - An owned permission to join on a task (await its termination).
- Runtime
- A runtime used to execute asynchronous tasks.
- Runtime
Handle - 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 underlyingTokioRuntime
. - spawn
- Spawns a future onto the runtime.
- spawn_
blocking - Runs the provided function on an executor dedicated to blocking operations.