compio_driverTrait OpCode
Source pub trait OpCode {
// Required methods
fn pre_submit(self: Pin<&mut Self>) -> Result<Decision>;
fn operate(self: Pin<&mut Self>) -> Poll<Result<usize>>;
// Provided method
fn op_type(self: Pin<&mut Self>) -> Option<OpType> { ... }
}
Expand description
Abstraction of operations.
Perform the operation before submit, and return Decision
to
indicate whether submitting the operation to polling is required.
Perform the operation after received corresponding
event. If this operation is blocking, the return value should be
Poll::Ready
.
Get the operation type when an event is occurred.