#run-time #async #async-trait #abstraction-layer #async-await #agnostic #sans

no-std agnostic-lite

agnostic-lite is a Sans-I/O abstraction layer for any async runtime

5 unstable releases

0.5.4 Jan 31, 2025
0.4.0 Jan 27, 2025
0.3.17 Dec 22, 2024
0.3.16 Oct 6, 2024
0.3.13 Mar 26, 2024

#1643 in Asynchronous

Download history 54/week @ 2024-10-21 25/week @ 2024-10-28 161/week @ 2024-11-04 19/week @ 2024-11-11 64/week @ 2024-11-18 56/week @ 2024-11-25 36/week @ 2024-12-02 54/week @ 2024-12-09 853/week @ 2024-12-16 680/week @ 2024-12-23 186/week @ 2024-12-30 469/week @ 2025-01-06 557/week @ 2025-01-13 184/week @ 2025-01-20 1542/week @ 2025-01-27 712/week @ 2025-02-03

3,042 downloads per month
Used in 24 crates (10 directly)

MIT/Apache

175KB
4.5K SLoC

Agnostic-Lite

agnostic-lite is a Sans-I/O abstraction layer for any async runtime.

In order to make it trivial for others to build implementations of any async runtime, this crate provides a sans-I/O 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.

github LoC Build codecov

docs.rs crates.io crates.io license

Introduction

agnostic-lite is a Sans-I/O abstraction layer for any async runtime.

In order to make it trivial for others to build implementations of any async runtime, this crate provides a sans-I/O 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 tasks
  • AsyncLocalSpawner: trait for spawning local tasks
  • AsyncSleep: trait for sleep functionality
  • AsyncInterval: trait for interval functionality
  • AsyncTimeout: 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.

Dependencies

~0.8–13MB
~164K SLoC