Trait OpCode

Source
pub trait OpCode<C: OpCompletion> {
    type Error;

    // Required methods
    fn submission(&mut self) -> Result<C, Self::Error>;
    fn completion(&mut self, _: Pin<&mut C>) -> Result<(), Self::Error>;
}
Expand description

The contracting type between io-uring-bearer and all the opcodes it can carry. Implement this type in the individual opcodes that can be used in the bearer.

Required Associated Types§

Source

type Error

It is recommended that you use a harmonized error type but is not mandatory.

Required Methods§

Source

fn submission(&mut self) -> Result<C, Self::Error>

Turn the abstract OpCoe into Submission that will be pending completion. io-uring-bearer will call this in order to convert the higher level type into actual submission.

Source

fn completion(&mut self, _: Pin<&mut C>) -> Result<(), Self::Error>

io-uring-bearer will call this upno completion

Implementors§