[][src]Crate iou

Idiomatic Rust bindings to liburing.

This gives users an idiomatic Rust interface for interacting with the Linux kernel's io_uring interface for async IO. Despite being idiomatic Rust, this interface is still very low level and some fundamental operations remain unsafe.

The core entry point to the API is the IoUring type, which manages an io_uring object for interfacing with the kernel. Using this, users can submit IO events and wait for their completion.

It is also possible to "split" an IoUring instance into its constituent components - a SubmissionQueue, a CompletionQueue, and a Registrar - in order to operate on them separately without synchronization.

Submitting events

You can prepare new IO events using the SQE type. Once an event has been prepared, the next call to submit will submit that event. Eventually, those events will complete, and that a CQE will appear on the completion queue indicating that the event is complete.

Preparing IO events is inherently unsafe, as you must guarantee that the buffers and file descriptors used for that IO are alive long enough for the kernel to perform the IO operation with them.


Some APIs allow you to time out a call into the kernel. It's important to note how this works with io_uring.

A timeout is submitted as an additional IO event which completes after the specified time. Therefore when you create a timeout, all that happens is that a completion event will appear after that specified time. This also means that when processing completion events, you need to be prepared for the possibility that the completion represents a timeout and not a normal IO event (CQE has a method to check for this).



Types related to completion queue events.


Types related to registration and registered resources.


Types related to submission queue events.



A completed IO event.


An iterator of CQEs from the CompletionQueue.


An iterator of CQEs from the CompletionQueue.


The queue of completed IO events.


The main interface to kernel IO using io_uring.


A probe of the operations supported by this kernel version's io-uring interface.


A Registrar creates ahead-of-time kernel references to files and user buffers.


A pending IO event.


A sequence of SQEs from the SubmissionQueue.


Advanced features that can be enabled when setting up an IoUring instance.


IoUring initialization flags for advanced use cases.


The queue of pending IO events.