compio_driver

Trait 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.

Required Methods§

Source

fn pre_submit(self: Pin<&mut Self>) -> Result<Decision>

Perform the operation before submit, and return Decision to indicate whether submitting the operation to polling is required.

Source

fn operate(self: Pin<&mut Self>) -> Poll<Result<usize>>

Perform the operation after received corresponding event. If this operation is blocking, the return value should be Poll::Ready.

Provided Methods§

Source

fn op_type(self: Pin<&mut Self>) -> Option<OpType>

Get the operation type when an event is occurred.

Implementors§

Source§

impl OpCode for CloseFile

Source§

impl OpCode for CloseSocket

Source§

impl OpCode for CreateDir

Source§

impl OpCode for CreateSocket

Source§

impl OpCode for OpenFile

Source§

impl OpCode for PathStat

Source§

impl OpCode for Rename

Source§

impl<D: Send + 'static, F: FnOnce() -> BufResult<usize, D> + Send + Sync + 'static> OpCode for Asyncify<F, D>

Source§

impl<S: AsRawFd> OpCode for Accept<S>

Source§

impl<S: AsRawFd> OpCode for Connect<S>

Source§

impl<S: AsRawFd> OpCode for FileStat<S>

Source§

impl<S: AsRawFd> OpCode for PollOnce<S>

Source§

impl<S: AsRawFd> OpCode for ShutdownSocket<S>

Source§

impl<S: AsRawFd> OpCode for Sync<S>

Source§

impl<T: IoBuf, S: AsRawFd> OpCode for Send<T, S>

Source§

impl<T: IoBuf, S: AsRawFd> OpCode for SendTo<T, S>

Source§

impl<T: IoBuf, S: AsRawFd> OpCode for WriteAt<T, S>

Source§

impl<T: IoBufMut, S: AsRawFd> OpCode for ReadAt<T, S>

Source§

impl<T: IoBufMut, S: AsRawFd> OpCode for Recv<T, S>

Source§

impl<T: IoBufMut, S: AsRawFd> OpCode for RecvFrom<T, S>

Source§

impl<T: IoVectoredBuf, C: IoBuf, S: AsRawFd> OpCode for SendMsg<T, C, S>

Source§

impl<T: IoVectoredBuf, S: AsRawFd> OpCode for SendToVectored<T, S>

Source§

impl<T: IoVectoredBuf, S: AsRawFd> OpCode for SendVectored<T, S>

Source§

impl<T: IoVectoredBuf, S: AsRawFd> OpCode for WriteVectoredAt<T, S>

Source§

impl<T: IoVectoredBufMut, C: IoBufMut, S: AsRawFd> OpCode for RecvMsg<T, C, S>

Source§

impl<T: IoVectoredBufMut, S: AsRawFd> OpCode for ReadVectoredAt<T, S>

Source§

impl<T: IoVectoredBufMut, S: AsRawFd> OpCode for RecvFromVectored<T, S>

Source§

impl<T: IoVectoredBufMut, S: AsRawFd> OpCode for RecvVectored<T, S>