safer-ring 0.0.1

A safe Rust wrapper around io_uring with zero-cost abstractions and compile-time memory safety guarantees
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// This test should fail to compile because pooled buffers cannot outlive their pool

use safer_ring::{BufferPool, Ring};

fn main() {
    let ring = Ring::new(10).unwrap();
    let mut buffer = {
        let pool = BufferPool::new(10, 1024);
        pool.get().unwrap() // This buffer should not be able to outlive the pool
    };
    
    // This should not compile - buffer references dropped pool
    let _future = ring.read(0, buffer.as_mut_slice());
}