fio 0.0.0-alpha.1

An io_uring-backed async runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn main() {
    fio::block_on(async |io| {
        let buf = vec![0; 256];

        let f = io.open("Cargo.toml").await.expect("should open file");
        let (buf, res) = io.read(buf, f).await;
        let n = res.expect("should read");
        println!("---");
        println!("read {n} bytes:");
        let content = std::str::from_utf8(&buf[..n]).expect("invalid utf-8");
        println!("{}", content.trim());
        println!("---");
    });
}