#async #async-io #future #io #non-blocking #codebase

arta-async-std

Async abstractions implementation for async-std

1 unstable release

0.2.1 Jul 19, 2024
0.2.0 Jul 4, 2024

#1794 in Asynchronous

MIT license

92KB
1.5K SLoC

arta

Arta is an asynchronous runtime abstractions library for Rust, designed to provide a flexible and powerful interface for building asynchronous applications. With arta, you can abstract over different async runtimes, making your code async runtime agnostic.

Features

  • Easy Integration: Seamlessly integrate with existing async codebases.
  • Flexible API: Use a consistent API regardless of the underlying runtime.
  • Lightweight: No overhead, designed for performance.

Installation

Add arta to your Cargo.toml:

[dependencies]
arta = "0.1.0"

lib.rs:

arta-async-std

Arta-async-std is a crate that provides an implementation of arta abstractions for async-std runtime.

Installation

Add a following dependencies to your Cargo.toml:

[dependencies]
arta-async-std = "0.1.0"
arta = "0.1.1"
async-std = { version = "1.12.0", features = ["attributes"] }

Usage

#[async_std::main]
async fn main() {
    // After async-std runtime was initialized just call methods on `AsyncStdGlobalRuntime` to use
    // this crate.
    // Example:
    let hosts = AsyncStdGlobalRuntime.read_to_string("/etc/hosts").await.unwrap();
    println!("Hosts: {hosts}");
}

Dependencies

~5–14MB
~184K SLoC