3 releases

0.0.5 Nov 8, 2022
0.0.4 Oct 5, 2022
0.0.2 Oct 5, 2022

#347 in #write

Download history 50/week @ 2024-02-19 60/week @ 2024-02-26 18/week @ 2024-03-04 18/week @ 2024-03-11 10/week @ 2024-03-18 18/week @ 2024-03-25 57/week @ 2024-04-01 3/week @ 2024-04-08 4/week @ 2024-04-15

82 downloads per month
Used in 5 crates (2 directly)

MIT license

10KB
177 lines

PhotonIO

crates docs

PhotonIO is an efficient runtime for asynchronous applications in Rust.

Features

  • Asynchronous filesystem and networking I/O for Linux based on io_uring.
  • A fallback implementation for other platforms based on Tokio.
  • A multi-thread runtime.

Examples

use photonio::{fs::File, io::Write, io::WriteAt};

#[photonio::main]
async fn main() -> std::io::Result<()> {
    let mut file = File::create("hello.txt").await?;
    file.write(b"hello").await?;
    file.write_at(b"world", 5).await?;
    Ok(())
}

Limitations

  • Dropping an unfinished future for asynchronous filesystem or networking operations will result in a panic. However, this behavior might be change in the future.
  • The current multi-thread runtime uses a naive round-robin fashion to schedule tasks. A work-stealing scheduler will be added in the future.

lib.rs:

The base of PhotonIO.

No runtime deps