dope-sys 0.75.0

Typed operating-system call contracts
Documentation
mod chain;

use std::{num, pin};

pub use chain::Chain;

use crate::io::socket::option::tuning::Occupied;

/// # Safety
/// Pinned values retain their addresses until the exact chain terminates.
pub unsafe trait State<E: Copy, const N: usize>: Default {
    type Occupied<'a>: Occupied<E>
    where
        Self: 'a;

    fn bind(self: pin::Pin<&mut Self>) -> Option<Self::Occupied<'_>>;

    /// # Safety
    /// No prior chain is live; `count` equals the option CQE count and is at most N.
    /// Keep this owner pinned and all values live through every CQE or quiescence.
    unsafe fn values(
        self: pin::Pin<&mut Self>,
        target: E,
        count: num::NonZero<u32>,
    ) -> &mut [libc::c_int; N];
}