| Crates.io | ato |
| lib.rs | ato |
| version | 2.0.3 |
| created_at | 2025-05-29 08:56:52.735877+00 |
| updated_at | 2026-01-24 22:49:17.827505+00 |
| description | A very minimal no-std async runtime |
| homepage | |
| repository | https://github.com/SeaRoll/ato |
| max_upload_size | |
| id | 1693609 |
| size | 26,819 |
no_std and no_alloc EnvironmentsATO is a minimal asynchronous task runtime designed for no_std and no_alloc environments, making it suitable for embedded systems, operating system kernels, or other resource-constrained applications where the standard library is unavailable.
It provides a basic task spawner and a round-robin scheduler to run Futures to completion.
no_std Compatible: Works in environments without the standard library.sleep function that requires a user-provided time source.heapless::Q* for a statically-sized task queue, configurable at compile time.In many no_std contexts, a full-fledged async runtime like Tokio or async-std is too heavy or relies on
operating system features that aren't available. ATO aims to provide the bare essentials for cooperative
multitasking with futures in such environments.
Add ATO to your Cargo.toml:
[dependencies]
ato = "2.0.2" # Replace with the desired version
Here's a basic example of how to use ATO:
const SPAWNER_SIZE: usize = 4; // Must be a power of two, e.g., 2, 4, 8, 16, etc.
fn main() {
// create a spawner with the specified size
let spawner: ato::Spawner<SPAWNER_SIZE> = ato::Spawner::default();
// create a simple task that prints a message
ato::spawn_task!(spawner, res, {
println!("Hello, World!");
});
res.unwrap();
// run until all tasks are done running
spawner.run_until_all_done().unwrap();
}