compio 0.18.0

Completion based async runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use compio::{fs::OpenOptions, io::AsyncReadAtExt};

#[compio::main]
async fn main() {
    let file = OpenOptions::new()
        .read(true)
        .open("Cargo.toml")
        .await
        .unwrap();
    let (read, buffer) = file
        .read_to_end_at(Vec::with_capacity(4096), 0)
        .await
        .unwrap();
    assert_eq!(read, buffer.len());
    let buffer = String::from_utf8(buffer).unwrap();
    println!("{buffer}");
    file.close().await.unwrap();
}