Skip to main content

Module io

Module io 

Expand description

Bulk file I/O for async code, on dedicated threads.

tokio::fs sends every call through the runtime’s blocking pool, one thread hop per read or write, sharing that pool with every other blocking call in the process. Storage data paths instead submit whole operations here: std I/O on a small fixed pool of tilo-io-N threads.

The operations are deliberately few and owned — whole-file read and write, positioned read and write on a shared File, fsync — because that is the shape an io_uring submission queue takes. Replacing the pool with a ring changes this module, not its callers. run is the escape hatch for a compound operation (open, stat, rename) that has no dedicated entry point yet.

Functions§

read
Read a whole file.
read_at
Read up to len bytes at offset. Returns fewer only at end of file.
run
Run op on an I/O thread and await its result.
sync_all
Flush file’s data and metadata to the device.
write
Create or truncate path and write contents to it.
write_all_at
Write all of data at offset.