Trait OpCode
pub trait OpCode {
// Required methods
fn pre_submit(self: Pin<&mut Self>) -> Result<Decision, Error>;
fn operate(self: Pin<&mut Self>) -> Poll<Result<usize, Error>>;
// Provided method
fn op_type(self: Pin<&mut Self>) -> Option<OpType> { ... }
}Expand description
Abstraction of operations.
§Implementation notes
If pre_submit returns Decision::Wait, op_type must also return
Some(OpType::Fd) with same fds as the WaitArgs. Similarly, if
pre_submit returns Decision::Aio, op_type must return
Some(OpType::Aio) with the correct aiocb pointer.