pub unsafe trait PollOpCode {
type Control: Default;
// Required methods
fn pre_submit(&mut self, _: &mut Self::Control) -> Result<Decision>;
fn operate(&mut self, _: &mut Self::Control) -> Poll<Result<usize>>;
// Provided methods
unsafe fn init(&mut self, _: &mut Self::Control) { ... }
fn op_type(&mut self, _: &mut Self::Control) -> Option<OpType> { ... }
unsafe fn set_result(
&mut self,
_: &mut Self::Control,
_: &Result<usize>,
_: &Extra,
) { ... }
}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 Associated Types§
Required Methods§
Provided Methods§
Sourceunsafe fn init(&mut self, _: &mut Self::Control)
unsafe fn init(&mut self, _: &mut Self::Control)
Initialize the control
§Safety
Caller must guarantee that during the lifetime of ctrl, Self is
unmoved and valid.
Implementors§
Source§impl<S1, S2, D, F> OpCode for AsyncifyFd2<S1, S2, F, D>
Available on polling only.
impl<S1, S2, D, F> OpCode for AsyncifyFd2<S1, S2, F, D>
Available on
polling only.Source§impl<S, D, F> OpCode for AsyncifyFd<S, F, D>
Available on polling only.
impl<S, D, F> OpCode for AsyncifyFd<S, F, D>
Available on
polling only.