pub(crate) unsafe fn into_sqe(self) -> Sqe {
        // Safe because all-zero value is valid. The sqe is made up of integers and raw pointers.
        let mut inner: io_uring_sqe = std::mem::zeroed();

        inner.opcode = self.opcode as u8;
        inner.fd = self.fd as i32;
        // Simplifying assumption that we only used pre-registered FDs.
        inner.flags = self.flags | (1 << IOSQE_FIXED_FILE_BIT);

        if let Some(addr) = self.addr {
            inner.__bindgen_anon_2.addr = addr as u64;
        }

        if let Some(len) = self.len {
            inner.len = len;
        }

        if let Some(offset) = self.offset {
            inner.__bindgen_anon_1.off = offset;
        }
        inner.user_data = Box::into_raw(self.user_data) as u64;

        Sqe::new(inner)
    }
/// Transform the operation into an `Sqe`.
///
/// # Safety
/// Unsafe because we turn the Boxed user_data into a raw pointer contained in the sqe.
/// It's up to the caller to make sure that this value is freed (not leaked).
Transform the operation into an `Sqe`.
Transform the operation into an ` Sqe ` .
pub(crate) unsafe fn into_sqe(self) -> Sqe {
        // Safe because all-zero value is valid. The sqe is made up of integers and raw pointers.
        let mut inner: io_uring_sqe = std::mem::zeroed();
        inner.opcode = self.opcode as u8;
        inner.fd = self.fd as i32;
        // Simplifying assumption that we only used pre-registered FDs.
        inner.flags = self.flags | (1 << IOSQE_FIXED_FILE_BIT);
        if let Some(addr) = self.addr {
            inner.__bindgen_anon_2.addr = addr as u64;
        }
        if let Some(len) = self.len {
            inner.len = len;
        }
        if let Some(offset) = self.offset {
            inner.__bindgen_anon_1.off = offset;
        }
        inner.user_data = Box::into_raw(self.user_data) as u64;
        Sqe::new(inner)
    }
pub ( crate ) unsafe fn into_sqe ( self ) -> Sqe { // Safe because all-zero value is valid. The sqe is made up of integers and raw pointers. let mut inner : io_uring_sqe = std :: mem :: zeroed ( ) ; inner . opcode = self . opcode as u8 ; inner . fd = self . fd as i32 ; // Simplifying assumption that we only used pre-registered FDs. inner . flags = self . flags | ( 1 << IOSQE_FIXED_FILE_BIT ) ; if let Some ( addr ) = self . addr { inner . __bindgen_anon_2 . addr = addr as u64 ; } if let Some ( len ) = self . len { inner . len = len ; } if let Some ( offset ) = self . offset { inner . __bindgen_anon_1 . off = offset ; } inner . user_data = Box :: into_raw ( self . user_data ) as u64 ; Sqe :: new ( inner ) }
Transform the operation into an `Sqe`.
Transform the operation into an ` Sqe ` .
self
self
safety
Unsafe because we turn the Boxed user_data into a raw pointer contained in the sqe.
It's up to the caller to make sure that this value is freed (not leaked).
Unsafe because we turn the Boxed user_data into a raw pointer contained in the sqe . It ' s up to the caller to make sure that this value is freed ( not leaked ) .