Trait Completable

Source
pub unsafe trait Completable: 'static + Unpin {
    type Output;
    type Driver: DriverHandle;

    // Required methods
    fn complete(
        self,
        driver: &Self::Driver,
        payload: <Self::Driver as DriverHandle>::Payload,
    ) -> Self::Output;
    fn cancel(self, driver: &Self::Driver) -> Cancellation;

    // Provided method
    fn complete_ext(
        self,
        driver: &Self::Driver,
        payload: <Self::Driver as DriverHandle>::Payload,
        ext: <Self::Driver as DriverHandle>::Ext,
    ) -> Self::Output
       where Self: Sized { ... }
}
Expand description

§Safety

All submitted resources must be recycled.

Required Associated Types§

Required Methods§

Source

fn complete( self, driver: &Self::Driver, payload: <Self::Driver as DriverHandle>::Payload, ) -> Self::Output

Transforms the received payload to the corresponding output.

This function is called when the operation is completed, and the output is then returned as Poll::Ready.

Source

fn cancel(self, driver: &Self::Driver) -> Cancellation

Cancels this operation.

Provided Methods§

Source

fn complete_ext( self, driver: &Self::Driver, payload: <Self::Driver as DriverHandle>::Payload, ext: <Self::Driver as DriverHandle>::Ext, ) -> Self::Output
where Self: Sized,

Completes this operation with the submitted extension.

For more information, see complete.

Implementors§