| Crates.io | orb-smol |
| lib.rs | orb-smol |
| version | 0.5.0 |
| created_at | 2025-10-29 09:12:17.561027+00 |
| updated_at | 2025-11-01 03:54:33.306515+00 |
| description | orb interface adaptor for smol-rs ecology. Orb is an abstraction for writing runtime agnostic async code. |
| homepage | |
| repository | https://github.com/NaturalIO/orb |
| max_upload_size | |
| id | 1906274 |
| size | 34,155 |
Orb is an abstraction layer for writing runtime-agnostic async Rust code, allowing you to write code that works with different async runtimes, like tokio or smol.
We took the name Orb because it gets around :)
UnifyListener / UnifyStreamResolveAddr traitThe main goal is to decouple your application logic from specific async runtime implementations, allowing you to:
Write portable async code that works at the same time in combination of multiple runtimes
Switch to new runtimes without changing your core logic
Test your code with different runtime characteristics
Enhance async network programing experience
This is a side project during the development of razor-rpc. Because:
#[cfg(feature=xxx)] in code makes it hard to read.smol ecology enable you to customize executors, but there's high learning cost, and lack utility functions (for example, there's no timeout function in async-io or smol).This is why this crate was written.
To use Orb, you need to depend on both the core orb crate and a runtime adapter crate like orb-tokio or orb-smol.
In your Cargo.toml:
[dependencies]
# when you write runtime agnostic codes
orb = "0"
# when you setup as end-user
orb-tokio = "0"
# or
orb-smol = "0"
There's a global trait AsyncRuntime that combines all features at the crate level, and adding use orb::prelude::* will import all the traits you need.
There are some variants of the new() function, also refer to the documentation in the sub-crates:
This project is licensed under the MIT License - see the LICENSE file for details.