dope-uring 0.37.0

Owned io_uring backend for dope
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::{marker, mem};

use crate::reactor::sq;

/// An SQE whose encoded fields do not borrow caller-owned memory.
#[repr(transparent)]
pub struct Owned<T>(sq::Entry, marker::PhantomData<fn(T) -> T>);

impl<T> Owned<T> {
    pub(crate) const fn new(entry: sq::Entry) -> Self {
        Self(entry, marker::PhantomData)
    }
}

const _: () = assert!(mem::size_of::<Owned<()>>() == mem::size_of::<sq::Entry>());