dope-sys 0.77.0

Typed operating-system call contracts
Documentation
use crate::{
    Errno,
    io::reactor::{complete::flags::Flow, event::kind},
};
use o3::{base::num::bounded, buffer::bytes::bounded::MAX};

type Count = bounded::raw::U32<0, { MAX as u32 }>;

pub trait Flight: Sized {
    type Key;
    type Observation;
    type Fault;
    type Reported;
    type Token;
    type Target<K: kind::Flight>: Copy + Into<Self::Token>;
    type Length: Copy + From<Count> + Into<Count>;
    type Descriptor;
    type AcceptFailure: Copy;
    type Created;
    type SocketFailure: Copy;
    type Exhausted;
    type Owned;

    fn finish(self);
    fn end(self, flow: Flow) -> Self::Key;
    fn kind(&self) -> kind::Native;
    fn target<K: kind::Flight>(&self, proof: kind::Witness<K>) -> Self::Target<K>;
    fn settle<K: kind::Flight>(self, proof: kind::Witness<K>, flow: Flow) -> Self::Target<K>;
    fn reject(self, flow: Flow) -> Self::Token;
    fn owned(
        self,
        proof: kind::Witness<kind::SendOwned>,
        result: Result<Self::Length, Errno>,
    ) -> Self::Owned;
}