#syscalls #async-await #runtimes #abstraction #future #async-std #tokio

no-std rasi

An implementation of Rust Asynchronous System Interface(RASI)

11 releases

0.1.11 Mar 15, 2024
0.1.10 Mar 12, 2024
0.1.0 Feb 29, 2024

#596 in Asynchronous

Download history 484/week @ 2024-02-29 380/week @ 2024-03-07 507/week @ 2024-03-14 34/week @ 2024-03-21 4/week @ 2024-03-28

605 downloads per month
Used in 3 crates (2 directly)

MIT license

190KB
2.5K SLoC

RASI

CI Release "Crates.io version" "docs.rs docs"

architectural

The Rust Asynchronous System Interface (RASI) provides a unified API interface to Rust's asynchronous runtimes (such as tokio, async-std, etc.).

Motivation

Now, Rust has various implementations of the async runtime, most of which are compatible with the official futures, with the exception of tokio, which is a maverick.

However, simply using futures does not result in a runtime portable program.

For example, when you need to improve the performance of your application on the linux platform and try to replace tokio's default network mod implementation with io_uring, you can't do it very easily.

This is because the futures library is missing several key abstractions:

  • task
  • network
  • filesystem
  • time

RASI attempts to be a portable abstraction layer for asynchronous runtimes, either as a decorator for existing asynchronous runtimes or as a good starting point for newly developed asynchronous runtimes.

SYSCALL

The RASI defines a set of Syscalls to fill in the missing abstractions in the Futures crate:

  • Executor for working with asynchronous tasks.
  • Network primitives for TCP/UDP communication.
  • FileSystem manipulation operations.
  • Timer Utilities for tracking time.

All of the above Syscalls can be implemented separately and injected into a runtime portable program. When replacing any of the system call modules, your program code does not need to be changed except for the inject code.

Examples

Visit the reference implementation of the syscall for more information.

Also, you can apply it to your portable programs as appropriate.

Dependencies

~1–1.8MB
~36K SLoC