| Crates.io | liburing-rs |
| lib.rs | liburing-rs |
| version | 0.2.0 |
| created_at | 2025-10-03 16:55:25.209389+00 |
| updated_at | 2025-10-03 22:31:16.565979+00 |
| description | Rust bindings and idiomatic wrapper for liburing |
| homepage | |
| repository | https://github.com/charmitro/liburing-rs |
| max_upload_size | |
| id | 1866956 |
| size | 152,091 |
Rust bindings for liburing (Linux io_uring).
This provides Rust FFI bindings and idiomatic wrappers for https://github.com/axboe/liburing
Debian/Ubuntu:
.. code:: bash
apt install liburing-dev
Fedora:
.. code:: bash
dnf install liburing-devel
Arch:
.. code:: bash
pacman -S liburing
From source:
.. code:: bash
git clone https://github.com/axboe/liburing.git cd liburing ./configure make sudo make install
.. code:: bash
cargo build --release
The build script:
Synchronous API:
.. code:: rust
use liburing_rs::{IoUring, ops::*};
let mut ring = IoUring::new(32)?;
// Submit operations { let mut sq = ring.submission(); let sqe = sq.get_sqe_or_err()?; Nop.prepare(sqe); sqe.set_user_data(1); }
ring.submit()?;
// Get completions let mut cq = ring.completion(); let cqe = cq.wait_cqe()?; println!("Result: {}", cqe.result());
Async API (tokio):
.. code:: rust
use liburing_rs::async_io::AsyncIoUring; use liburing_rs::ops::Nop;
let mut ring = AsyncIoUring::new(32)?; let result = ring.submit_op(Nop).await?; println!("Result: {}", result);
Enable with async-tokio feature:
.. code:: toml
liburing-rs = { version = "0.1", features = ["async-tokio"] }
Async API (async-std):
Enable with async-async-std feature:
.. code:: toml
liburing-rs = { version = "0.1", features = ["async-async-std"] }
Synchronous examples:
.. code:: bash
cargo run --example nop
cargo run --release --example io_uring-cp source.txt dest.txt
cargo run --release --example link-cp source.txt dest.txt
cargo run --release --example poll-bench
Async examples:
.. code:: bash
cargo run --example async_nop_tokio --features async-tokio
cargo run --example async_nop_async_std --features async-async-std
cargo run --release --example async_poll_bench --features async-tokio
cargo run --release --example async_poll_bench_async_std --features async-async-std
.. code:: bash
cargo test --all
Coverage includes:
Four layers:
poll-bench achieves ~12M ops/sec (93% of C liburing performance).
MIT
Charalampos Mitrodimas charmitro@posteo.net