{"id":13415617,"url":"https://github.com/tokio-rs/io-uring","last_synced_at":"2025-05-12T15:25:31.463Z","repository":{"id":38886870,"uuid":"214487724","full_name":"tokio-rs/io-uring","owner":"tokio-rs","description":"The `io_uring` library for Rust","archived":false,"fork":false,"pushed_at":"2025-04-29T15:53:34.000Z","size":665,"stargazers_count":1349,"open_issues_count":50,"forks_count":149,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-05-11T01:32:19.676Z","etag":null,"topics":["io-uring","linux","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tokio-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-11T16:55:33.000Z","updated_at":"2025-05-10T05:07:33.000Z","dependencies_parsed_at":"2023-12-27T16:04:55.436Z","dependency_job_id":"9ec51e3e-bf26-4208-9361-da909c1f0cf7","html_url":"https://github.com/tokio-rs/io-uring","commit_stats":{"total_commits":327,"total_committers":47,"mean_commits":6.957446808510638,"dds":"0.31498470948012236","last_synced_commit":"c88432222f05ce657a971a87784f64ae46ff1e16"},"previous_names":["quininer/linux-io-uring"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokio-rs%2Fio-uring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokio-rs%2Fio-uring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokio-rs%2Fio-uring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokio-rs%2Fio-uring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokio-rs","download_url":"https://codeload.github.com/tokio-rs/io-uring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253667004,"owners_count":21944771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["io-uring","linux","rust-lang"],"created_at":"2024-07-30T21:00:50.804Z","updated_at":"2025-05-12T15:25:31.453Z","avatar_url":"https://github.com/tokio-rs.png","language":"Rust","funding_links":[],"categories":["Rust","Libraries"],"sub_categories":["Rust"],"readme":"# Linux IO Uring\n[![github actions](https://github.com/tokio-rs/io-uring/workflows/ci/badge.svg)](https://github.com/tokio-rs/io-uring/actions)\n[![crates](https://img.shields.io/crates/v/io-uring.svg)](https://crates.io/crates/io-uring)\n[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/tokio-rs/io-uring/blob/master/LICENSE-MIT)\n[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/tokio-rs/io-uring/blob/master/LICENSE-APACHE)\n[![docs.rs](https://docs.rs/io-uring/badge.svg)](https://docs.rs/io-uring/)\n\nThe low-level [`io_uring`](https://kernel.dk/io_uring.pdf) userspace interface for Rust.\n\n## Usage\n\nTo use `io-uring` crate, first add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nio-uring = \"0.7\"\n```\n\nNext we can start using `io-uring` crate.\nThe following is quick introduction using `Read` for file.\n\n```rust\nuse io_uring::{opcode, types, IoUring};\nuse std::os::unix::io::AsRawFd;\nuse std::{fs, io};\n\nfn main() -\u003e io::Result\u003c()\u003e {\n    let mut ring = IoUring::new(8)?;\n\n    let fd = fs::File::open(\"README.md\")?;\n    let mut buf = vec![0; 1024];\n\n    let read_e = opcode::Read::new(types::Fd(fd.as_raw_fd()), buf.as_mut_ptr(), buf.len() as _)\n        .build()\n        .user_data(0x42);\n\n    // Note that the developer needs to ensure\n    // that the entry pushed into submission queue is valid (e.g. fd, buffer).\n    unsafe {\n        ring.submission()\n            .push(\u0026read_e)\n            .expect(\"submission queue is full\");\n    }\n\n    ring.submit_and_wait(1)?;\n\n    let cqe = ring.completion().next().expect(\"completion queue is empty\");\n\n    assert_eq!(cqe.user_data(), 0x42);\n    assert!(cqe.result() \u003e= 0, \"read error: {}\", cqe.result());\n\n    Ok(())\n}\n```\n\nNote that opcode `Read` is only available after kernel 5.6.\nIf you use a kernel lower than 5.6, this example will fail.\n\n## Test and Benchmarks\n\nYou can run the test and benchmark of the library with the following commands.\n\n```\n$ cargo run --package io-uring-test\n$ cargo bench --package io-uring-bench\n```\n\n\n### License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in io-uring by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokio-rs%2Fio-uring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokio-rs%2Fio-uring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokio-rs%2Fio-uring/lists"}