compio_driver

Trait OpCode

source
pub trait OpCode {
    // Required methods
    fn pre_submit(self: Pin<&mut Self>) -> Result<Decision>;
    fn on_event(self: Pin<&mut Self>, event: &Event) -> Poll<Result<usize>>;
}
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 on_event(self: Pin<&mut Self>, event: &Event) -> Poll<Result<usize>>

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

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>