Crate agnostic_lite
source ·Expand description
Agnostic-Lite
agnostic-lite is WASM friendly and light version of agnostic, for users who want to write async runtime-agnostic crate.
English | 简体中文
§Introduction
agnostic-lite is WASM friendly and light version of agnostic, for users who want to write async runtime-agnostic crate.
agnostic-lite splits the big Runtime trait in agnostic in multiple small traits:
-
AsyncSpawner: trait for spawning tasksBuiltin supports runtimes
tokioasync-stdsmol
-
AsyncLocalSpawner: trait for spawning local tasksBuiltin supports runtimes
tokioasync-stdsmolwasm-bindgen-futures
-
AsyncSleep: trait for sleep functionalityBuiltin supports runtimes
tokioasync-stdsmolwasm-bindgen-futures
-
AsyncInterval: trait for interval functionalityBuiltin supports runtimes
tokioasync-stdsmolwasm-bindgen-futures
-
AsyncTimeout: trait for timeout functionalityBuiltin supports runtimes
tokioasync-stdsmolwasm-bindgen-futures
§Installation
[dependencies]
agnostic-lite = "0.2"
§License
agnostic-lite is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2024 Al Liu.
Structs§
- AsyncIoInterval
stdandasync-io - AsyncIoSleep
stdandasync-io - AsyncIoTimeout
stdandasync-io - AsyncStdLocalSpawner
async-stdAAsyncLocalSpawnerthat uses theasync-stdruntime. - AsyncStdSpawner
async-stdAAsyncSpawnerthat uses theasync-stdruntime. - Elapsed error
- SmolLocalSpawner
smolAAsyncLocalSpawnerthat uses thesmolruntime. - SmolSpawner
smolAAsyncSpawnerthat uses thesmolruntime. - TokioInterval
stdandtokioTheAsyncIntervalimplementation for tokio runtime - TokioLocalSpawner
tokioAAsyncLocalSpawnerthat uses thetokioruntime. - TokioSleep
stdandtokioTheAsyncSleepimplementation for tokio runtime - TokioSpawner
tokioAAsyncSpawnerthat uses thetokioruntime. - TokioTimeout
stdandtokioTheAsyncTimeoutimplementation for tokio runtime - WasmInterval
stdandwasmTheAsyncIntervalimplementation for wasm runtime. - The join handle returned by
WasmLocalSpawner. - WasmLocalSpawner
wasmAAsyncLocalSpawnerthat uses thewasm-bindgen-futuresruntime. - WasmSleep
stdandwasmTheAsyncSleepimplementation for wasm-bindgen based runtime. - WasmTimeout
stdandwasmTheAsyncTimeoutimplementation for wasm bindgen
Traits§
- The interval abstraction for a runtime.
- Extension trait for
AsyncInterval. - A spawner trait for spawning futures.
- AsyncSleep
stdThe sleep abstraction for a runtime. - Extension trait for
AsyncSleep. - A spawner trait for spawning futures.
- The timeout abstraction for async runtime.