Expand description
Agnostic-Lite
agnostic-lite
is an agnostic abstraction layer for any async runtime.
In order to make it trivial for others to build implementations of any async runtime, this crate provides an abstraction layer implementation.
In addition, this crate is not only no_std
, but also alloc-free. This means that it can be used in environments where alloc is not available, such as embedded systems. It also has no unsafe code.
§Introduction
agnostic-lite
is an agnostic abstraction layer for any async runtime.
In order to make it trivial for others to build implementations of any async runtime, this crate provides an abstraction layer implementation.
In addition, this crate is not only no_std
, but also alloc-free. This means that it can be used in environments where alloc is not available, such as embedded systems. It also has no unsafe code.
agnostic-lite
splits the big Runtime
trait in agnostic
in multiple small traits:
AsyncSpawner
: trait for spawning tasksAsyncLocalSpawner
: trait for spawning local tasksAsyncSleep
: trait for sleep functionalityAsyncInterval
: trait for interval functionalityAsyncTimeout
: trait for timeout functionality
Builtin supports runtimes:
tokio
async-std
smol
wasm-bindgen-futures
§Installation
[dependencies]
agnostic-lite = "0.5"
§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) 2025 Al Liu.
Modules§
- async_
io async-io
- Time related traits concrete implementations for runtime based on
async-io
, e.g.async-std
,smol
. - async_
std async-std
- Concrete runtime implementations based on
async-std
runtime. - smol
smol
- Concrete runtime implementations based on
smol
runtime. - tests
test
ortest
- Unit test for the
RuntimeLite
- time
time
- Time related traits
- tokio
tokio
- Concrete runtime implementations based on
tokio
runtime. - wasm
wasm
- Concrete runtime implementations based on
wasm-bindgen-futures
.
Macros§
- cfg_
async_ std - Macro to conditionally compile items for
async-std
feature - cfg_
linux - Macro to conditionally compile items for
linux
system - cfg_
smol - Macro to conditionally compile items for
smol
feature - cfg_
tokio - Macro to conditionally compile items for
tokio
feature - cfg_
unix - Macro to conditionally compile items for
unix
system - cfg_
windows - Macro to conditionally compile items for
windows
system
Enums§
- After
Handle Error time
- Error of
AfterHandle
’s output
Traits§
- After
Handle time
- The handle returned by the
AsyncAfterSpawner
when a after future is spawned. - Async
After Spawner time
- A spawner trait for spawning futures. Go’s
time.AfterFunc
equivalent. - Async
Blocking Spawner - A spawner trait for spawning blocking.
- Async
Local Spawner - A spawner trait for spawning futures.
- Async
Spawner - A spawner trait for spawning futures.
- Join
Handle - Joinhanlde trait
- Local
Join Handle - Joinhanlde trait
- Runtime
Lite - Runtime trait
- Yielder
- Yielder hints the runtime to execution back