dope-sys 0.76.0

Typed operating-system call contracts
Documentation
use crate::{
    engine::admit,
    io::{
        reactor::{
            complete,
            read::{Complete, Context, Enabled, Family},
        },
        request,
        socket::addr,
    },
    table,
    table::{change, registry},
};

/// Registers and retires typed reads while borrowing their native owners.
pub trait Arm<'a, C: Context, E: Complete<Key = C::Key, Flow = C::Flow>, P>: Sized {
    type Files: table::Files<C::Slots>;
    type Entry: super::raw::Entry<
            C,
            File = <<Self::Files as table::Files<C::Slots>>::Changes as change::Changes>::Id,
        >;
    type Registry: registry::State<C::Slots, Self::Entry, Files = Self::Files>;
    type Failure;

    fn new(files: &'a mut Self::Files, reads: &'a mut Self::Registry, poll: &'a mut P) -> Self;
    fn accept_one(
        &mut self,
        key: C::Key,
        slot: <C::Slots as change::raw::Slots>::Physical,
        addr: &mut addr::Storage,
        vacant: impl complete::Vacancy<Event = E>,
    );
    fn accept_many(
        &mut self,
        key: C::Key,
        slot: <C::Slots as change::raw::Slots>::Physical,
        vacant: impl complete::Vacancy<Event = E>,
    );
    fn recv(
        &mut self,
        key: C::Key,
        slot: <C::Slots as change::raw::Slots>::Physical,
        vacant: impl complete::Vacancy<Event = E>,
    );
    fn message<I: request::Context>(
        &mut self,
        key: C::Key,
        fd: &I::Datagram<'_>,
        vacant: impl complete::Vacancy<Event = E>,
    ) where
        C::Slots: change::raw::Slots<Physical = I::Target>;
    fn try_cancel<F: From<Self::Failure>>(
        self,
        key: C::Key,
        family: Family,
        queue: &mut impl complete::Queue<Event = E>,
    ) -> Result<(), admit::Error<admit::Cause<F>>>;
    fn enable(&mut self, file: <Self::Entry as registry::Entry>::File, key: C::Key) -> Enabled;
    fn finish(&mut self, id: <Self::Entry as registry::Entry>::Id);
}