dope-uring 0.77.0

Owned io_uring backend for dope
Documentation
use std::ptr;

use dope_sys::io::file;
use dope_uring::Backend;

type Borrowed<'a> = <Backend as file::File>::Request<'a>;

pub trait Layout {
    fn encoded(&self) -> [u8; 64];
}

impl Layout for Borrowed<'_> {
    fn encoded(&self) -> [u8; 64] {
        // SAFETY: Borrowed transparently wraps Entry's initialized 64-byte ABI,
        // whose size and alignment are asserted in reactor::sq::entry;
        // reactor::sq::borrowed asserts that Borrowed retains the same size.
        unsafe { ptr::from_ref(self).cast::<[u8; 64]>().read() }
    }
}