Skip to main content

Crate nexio

Crate nexio 

Source
Expand description

nexio — a verified, single-core io_uring runtime.

§Design constraints

  1. Owned buffers only. The kernel holds a raw pointer from SQE submission until the matching CQE arrives. Borrowed &mut [u8] cannot model an external, uncancellable writer.

  2. Leak-until-real-completion cancellation. Dropping an in-flight op submits a best-effort ASYNC_CANCEL and moves the buffer into the reactor slab. Buffer freed only when the real CQE lands.

  3. !Send tasks, one reactor per thread. No work-stealing. Multi-core: N independent reactors + SO_REUSEPORT sharding.

  4. Verification-first. Pure-Rust layer (slab, Op state machine) targets Miri + Kani. Syscall-adjacent layer targets integration tests at high queue depth.

Re-exports§

pub use blocking::spawn_blocking;
pub use executor::block_on;
pub use executor::join2;
pub use executor::select2;
pub use executor::spawn;
pub use executor::yield_now;
pub use executor::JoinSet;
pub use profile::HardwareProfile;
pub use reactor::Reactor;

Modules§

addr
Asynchronous address resolution.
blocking
A thread pool for work that would block the reactor thread.
buf
Owned buffer types.
compat
Adapters between nexio’s owned-buffer streams and the poll-based I/O traits the wider ecosystem uses (tokio::io::AsyncRead/AsyncWrite, and hyper’s Read/Write).
executor
Single-threaded !Send task executor.
fs
Asynchronous file I/O backed by io_uring using owned buffers.
net
Networking on top of the nexio reactor.
process
Spawning and talking to child processes.
profile
Self-adaptive hardware and OS profile.
reactor
Thread-local io_uring reactor.
signal
Signal handling.
sync
Asynchronous synchronization primitives and channels.
time
Asynchronous time utilities: io_uring timeouts on the io_uring backend, the reactor’s timer map on the portable backend.

Functions§

io_uring_available
Return true if io_uring is compiled in and permitted by the kernel/sandbox in the current process.
run_sharded
Run factory(i) to completion on threads independent reactors, one OS thread each, and return every result in shard order.
run_sharded_auto
Run factory(i) on one shard per available CPU (respecting Linux cgroup quotas), returning every shard’s result in shard order.

Attribute Macros§

main
Marks an async fn main to be executed on the nexio runtime.
test
Marks an async fn test to be executed on the nexio runtime.