Skip to main content

PollOpCode

Trait PollOpCode 

Source
pub unsafe trait PollOpCode {
    // 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.

§Safety

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.

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 + 'static> OpCode for Asyncify<F, D>

Source§

impl<S1: AsFd, S2: AsFd> OpCode for Splice<S1, S2>

Available on linux_all only.
Source§

impl<S, D: Send + 'static, F: FnOnce(&S) -> BufResult<usize, D> + Send + 'static> OpCode for AsyncifyFd<S, F, D>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<S: AsFd> OpCode for ReadManaged<S>

Source§

impl<S: AsFd> OpCode for ReadManagedAt<S>

Source§

impl<S: AsFd> OpCode for RecvManaged<S>

Source§

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

Source§

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

Source§

impl<S: AsFd> OpCode for TruncateFile<S>

Source§

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

Source§

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

Source§

impl<T: IoBuf, S: AsFd> OpCode for Write<T, S>

Source§

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

Source§

impl<T: IoBufMut, S: AsFd> OpCode for Read<T, S>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: IoVectoredBuf, S: AsFd> OpCode for WriteVectored<T, S>

Source§

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

Source§

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

Source§

impl<T: IoVectoredBufMut, S: AsFd> OpCode for ReadVectored<T, S>

Source§

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

Source§

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

Source§

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