• Stars
    star
    946
  • Rank 46,540 (Top 1.0 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 3 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An io_uring backed runtime for Rust

tokio-uring

This crate provides io-uring for Tokio by exposing a new Runtime that is compatible with Tokio but also can drive io-uring-backed resources. Any library that works with Tokio also works with tokio-uring. The crate provides new resource types that work with io-uring.

API Docs | Chat

Getting started

Using tokio-uring requires starting a [tokio-uring] runtime. This runtime internally manages the main Tokio runtime and a io-uring driver.

In your Cargo.toml:

[dependencies]
tokio-uring = { version = "0.4.0" }

In your main.rs:

use tokio_uring::fs::File;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    tokio_uring::start(async {
        // Open a file
        let file = File::open("hello.txt").await?;

        let buf = vec![0; 4096];
        // Read some data, the buffer is passed by ownership and
        // submitted to the kernel. When the operation completes,
        // we get the buffer back.
        let (res, buf) = file.read_at(buf, 0).await;
        let n = res?;

        // Display the contents
        println!("{:?}", &buf[..n]);

        Ok(())
    })
}

Requirements

tokio-uring requires a very recent linux kernel. (Not even all kernels with io_uring support will work) In particular 5.4.0 does not work (This is standard on Ubuntu 20.4). However 5.11.0 (the ubuntu hwe image) does work.

Project status

The tokio-uring project is still very young. Currently, we are focusing on supporting filesystem and network operations. Eventually, we will add safe APIs for all io-uring compatible operations.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tokio-uring by you, shall be licensed as MIT, without any additional terms or conditions.

More Repositories

1

tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
Rust
23,031
star
2

axum

Ergonomic and modular web framework built with Tokio, Tower, and Hyper
Rust
15,842
star
3

mio

Metal I/O library for Rust.
Rust
6,057
star
4

tracing

Application level tracing for Rust.
Rust
4,883
star
5

mini-redis

Incomplete Redis client and server implementation using Tokio - for learning purposes only
Rust
3,563
star
6

prost

PROST! a Protocol Buffers implementation for the Rust Language
Rust
3,409
star
7

console

a debugger for async rust!
Rust
3,155
star
8

loom

Concurrency permutation testing tool for Rust.
Rust
1,847
star
9

bytes

Utilities for working with bytes
Rust
1,739
star
10

io-uring

The `io_uring` library for Rust
Rust
1,037
star
11

tokio-proto

A network application framework for Rust
Rust
694
star
12

turmoil

Add hardship to your tests
Rust
689
star
13

slab

Slab allocator for Rust
Rust
641
star
14

tokio-core

I/O primitives and event loop for async I/O in Rust
Rust
628
star
15

async-stream

Asynchronous streams for Rust using async & await notation
Rust
568
star
16

rdbc

Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Rust
558
star
17

tokio-minihttp

Protocol implementation experimentations
Rust
425
star
18

tokio-metrics

Utilities for collecting metrics from a Tokio application
Rust
254
star
19

tls

A collection of Tokio based TLS libraries.
Rust
243
star
20

website

Website for the Tokio project
TypeScript
211
star
21

valuable

Rust
180
star
22

async-backtrace

Rust
162
star
23

tracing-opentelemetry

Rust
155
star
24

tokio-io

Core I/O primitives for asynchronous I/O in Rust.
Rust
124
star
25

tokio-socks5

An example SOCKSv5 server implementation with tokio
Rust
100
star
26

tokio-tls

An implementation of TLS/SSL streams for Tokio
Rust
95
star
27

simulation

Framework for simulating distributed applications
Rust
92
star
28

tokio-timer

Timer facilities for Tokio
Rust
83
star
29

tokio-service

The core `Service` trait in Tokio and support
Rust
81
star
30

tokio-line

Line protocol for Tokio
Rust
64
star
31

tokio-redis

Redis client for Tokio
Rust
58
star
32

tokio-uds

Unix Domain Sockets for tokio
Rust
52
star
33

doc-push

Tokio doc blitz effort - A concerted effort to improve Tokio's documentation.
50
star
34

tokio-compat

Streamline updating a Tokio 0.1 application to Tokio 0.2.
Rust
48
star
35

book

43
star
36

tokio-openssl

OpenSSL bindings for Tokio
Rust
35
star
37

tokio-middleware

A collection of Tokio middleware
Rust
28
star
38

tokio-rfcs

22
star
39

async

Utilities building on top of Rust's async primitives.
Rust
22
star
40

console-gsoc

Google Summer of Code tokio-console prototype
Rust
11
star
41

service-fn

A service implemented by a closure
Rust
11
star
42

gsoc

Organize the Google Summer of Code projects.
6
star
43

cargo-tokio

A cargo subcommand to help building the Tokio project.
Rust
4
star
44

website-next

Next iteration of the Tokio website.
TypeScript
1
star