fiox

Crates.iofiox
lib.rsfiox
version0.2.0
created_at2025-12-15 05:48:29.854386+00
updated_at2025-12-29 02:37:33.488985+00
descriptionfile I/O using io_uring/iocp
homepage
repositoryhttps://github.com/keithyin/fiox
max_upload_size
id1985608
size60,482
kethyin (keithyin)

documentation

README

fiox

Build Status Crates.io

Zero-Copy, Asynchronous File I/O for Rust — powered by io_uring on Linux and IOCP on Windows, with built-in ring buffer support.

fiox delivers ultra-low-latency, high-throughput file I/O by leveraging modern kernel interfaces:

  • Linux: Direct io_uring integration (bypassing traditional syscall overhead)
  • Windows: Native I/O Completion Ports (IOCP) for scalable async I/O

Paired with efficient ring buffers, RingIO enables seamless zero-copy data pipelines


✨ Features

  • Cross-platform: Linux (io_uring) & Windows (IOCP)

  • Zero-copy reads/writes using direct io

  • ✅ Built-in SPSC ring buffers for high-speed data staging

  • ✅ Batching & coalescing for reduced syscalls

SequentialReader


let read_start_pos = 10;
let mut reader =
    SequentialReader::new("test_data/test_data.txt", read_start_pos, 4096, 2).unwrap();


let buf_size = 112560;
let mut buf = vec![0_u8; buf_size];
let mut read_size = 0;
loop {
    let n = reader.read2buf(&mut buf).unwrap();
    if n == 0 {
        break;
    }
    print!("{}", String::from_utf8((&buf[..n]).to_vec()).unwrap());
}

SequentialWriter

    
let mut writer =
    SequentialWriter::new("test_data/test_data_writer.txt", 0, 4096, 2).unwrap();
for i in 0..1000 {
    writer
        .write(format!("line:{}, abcdefghijklmnopqrstuvwxyz\n", i).as_bytes())
        .unwrap();
}
Commit count: 0

cargo fmt