Expand description
Core io_uring wrapper providing async file operations.
This module implements a thread-safe, async-compatible wrapper around Linux’s io_uring interface. It uses a dedicated submission thread and completion thread to manage the ring, allowing multiple async tasks to share a single ring instance.
§Architecture
┌─────────────┐ ┌───────────────────┐ ┌────────────────┐
│ Async Tasks │────▶│ Submission Thread │────▶│ io_uring │
│ (callers) │ │ (batches SQEs) │ │ (kernel space) │
└─────────────┘ └───────────────────┘ └───────┬────────┘
▲ │
│ ┌───────────────────┐ │
└────────────│ Completion Thread │◀────────────┘
│ (polls CQEs) │
└───────────────────┘§Thread Safety
The Uring struct is Clone + Send + Sync. Cloning is cheap (just clones the internal channel sender). All operations are thread-safe.
Structs§
- Read
Result - Result of a read operation: the buffer and actual bytes read.
- Registered
File - A file registered with a specific
Uringinstance for optimized I/O. - Uring
- Handle to a shared io_uring instance.
- Uring
Cfg - Configuration options for io_uring initialization.
- Write
Result - Result of a write operation: the buffer and actual bytes written.
Constants§
- URING_
LEN_ MAX - Maximum length for a single io_uring read/write operation.
Traits§
- IoBuf
- A buffer that can be used for io_uring write operations.
- IoBuf
Mut - A buffer that can be used for io_uring read operations.
- Uring
Target - Trait for types that can be used as file targets in io_uring operations.