PollOpCode

Trait PollOpCode 

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

Required Methods§

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

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

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

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

Provided Methods§

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

Get the operation type when an event is occurred.

Implementors§

§

impl OpCode for CloseFile

§

impl OpCode for CloseSocket

§

impl OpCode for CreateDir

§

impl OpCode for CreateSocket

§

impl OpCode for OpenFile

§

impl OpCode for PathStat

§

impl OpCode for Rename

§

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

§

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

Available on linux_all only.
§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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