Skip to main content

Wait

Trait Wait 

Source
pub trait Wait<S>: Sized {
    type Ring;
    type Owned;
    type Target;
    type Probe: Copy;
    type Outcome: Outcome<Probe = Self::Probe>;
    type Error;

    // Required methods
    fn submit(
        state: S,
        ring: impl for<'a> FnOnce(&'a mut S) -> &'a mut Self::Ring,
        entry: &Self::Owned,
        probe: Self::Probe,
    ) -> Result<Self, Stopped<S, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>;
    fn resume(
        stopped: Stopped<Self, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>,
        ring: impl for<'a> FnOnce(&'a mut S) -> &'a mut Self::Ring,
        report: impl FnMut(Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>),
    ) -> Result<Self, Stopped<Self, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>;
    fn finish(
        self,
        ring: impl for<'a> Fn(&'a mut S) -> &'a mut Self::Ring,
    ) -> Result<(S, Self::Outcome), Stopped<S, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>;
    fn next(
        self,
        ring: impl for<'a> FnOnce(&'a mut S) -> &'a mut Self::Ring,
    ) -> Result<(State<S, Self>, <Self as Wait<S>>::Outcome), Stopped<State<S, Self>, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>;
    fn cancel(
        self,
        ring: impl for<'a> Fn(&'a mut S) -> &'a mut Self::Ring,
    ) -> Result<S, Stopped<State<S, Self>, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>;
    unsafe fn option(
        state: S,
        access: impl for<'a> FnOnce(&'a mut S) -> (&'a mut Self::Ring, Self::Target, &'a c_int),
        probe: Self::Probe,
    ) -> Result<Self, Stopped<S, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>;
    unsafe fn inspect<E>(
        self,
        check: impl FnOnce(&mut S) -> Result<(), E>,
    ) -> Result<Self, Stopped<Self, E>>;
}
Expand description

A submitted capability canary retaining its complete owner until completion.

Required Associated Types§

Required Methods§

Source

fn submit( state: S, ring: impl for<'a> FnOnce(&'a mut S) -> &'a mut Self::Ring, entry: &Self::Owned, probe: Self::Probe, ) -> Result<Self, Stopped<S, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>

Source

fn resume( stopped: Stopped<Self, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>, ring: impl for<'a> FnOnce(&'a mut S) -> &'a mut Self::Ring, report: impl FnMut(Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>), ) -> Result<Self, Stopped<Self, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>

Reports the retained cause, then acknowledges only its unchanged unread head. Already-consumed completion checks never advance the queue during recovery.

Source

fn finish( self, ring: impl for<'a> Fn(&'a mut S) -> &'a mut Self::Ring, ) -> Result<(S, Self::Outcome), Stopped<S, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>

Source

fn next( self, ring: impl for<'a> FnOnce(&'a mut S) -> &'a mut Self::Ring, ) -> Result<(State<S, Self>, <Self as Wait<S>>::Outcome), Stopped<State<S, Self>, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>

Source

fn cancel( self, ring: impl for<'a> Fn(&'a mut S) -> &'a mut Self::Ring, ) -> Result<S, Stopped<State<S, Self>, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>

Source

unsafe fn option( state: S, access: impl for<'a> FnOnce(&'a mut S) -> (&'a mut Self::Ring, Self::Target, &'a c_int), probe: Self::Probe, ) -> Result<Self, Stopped<S, Cause<<Self as Wait<S>>::Probe, <<Self as Wait<S>>::Outcome as Outcome>::Observation, <Self as Wait<S>>::Error>>>

§Safety

The scalar stays at the same live address within state until terminal completion.

Source

unsafe fn inspect<E>( self, check: impl FnOnce(&mut S) -> Result<(), E>, ) -> Result<Self, Stopped<Self, E>>

§Safety

The inspector must retain the same owner and every outstanding kernel borrow.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§