Skip to main content

IourOpCode

Trait IourOpCode 

Source
pub unsafe trait IourOpCode {
    type Control: Default;

    // Required method
    fn create_entry(&mut self, _: &mut Self::Control) -> OpEntry;

    // Provided methods
    unsafe fn init(&mut self, _: &mut Self::Control) { ... }
    fn create_entry_fallback(&mut self, _: &mut Self::Control) -> OpEntry { ... }
    fn call_blocking(&mut self, _: &mut Self::Control) -> Result<usize> { ... }
    unsafe fn set_result(
        &mut self,
        _: &mut Self::Control,
        _: &Result<usize>,
        _: &Extra,
    ) { ... }
    unsafe fn push_multishot(
        &mut self,
        _: &mut Self::Control,
        _: Result<usize>,
        _: Extra,
    ) { ... }
    fn pop_multishot(
        &mut self,
        _: &mut Self::Control,
    ) -> Option<BufResult<usize, Extra>> { ... }
}
Expand description

Abstraction of io-uring operations.

§Safety

The returned Entry from create_entry must be valid until the operation is completed.

Required Associated Types§

Source

type Control: Default

Type that contains self-references and other needed info during the operation

Required Methods§

Source

fn create_entry(&mut self, _: &mut Self::Control) -> OpEntry

Create submission entry.

Provided Methods§

Source

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.

Source

fn create_entry_fallback(&mut self, _: &mut Self::Control) -> OpEntry

Create submission entry for fallback. This method will only be called if create_entry returns an entry with unsupported opcode.

Source

fn call_blocking(&mut self, _: &mut Self::Control) -> Result<usize>

Call the operation in a blocking way. This method will be called if

Source

unsafe fn set_result( &mut self, _: &mut Self::Control, _: &Result<usize>, _: &Extra, )

Set the result when it completes. The operation stores the result and is responsible to release it if the operation is cancelled.

§Safety

The params must be the result coming from this operation.

Source

unsafe fn push_multishot( &mut self, _: &mut Self::Control, _: Result<usize>, _: Extra, )

Push a multishot result to the inner queue.

§Safety

The params must be the result coming from this operation.

Source

fn pop_multishot( &mut self, _: &mut Self::Control, ) -> Option<BufResult<usize, Extra>>

Pop a multishot result from the inner queue.

Implementors§

Source§

impl OpCode for CloseFile

Source§

impl OpCode for CloseSocket

Source§

impl OpCode for CreateSocket

Source§

impl OpCode for Pipe

Source§

impl<C: IoBufMut, S: AsFd> OpCode for RecvMsgManaged<C, S>

Source§

type Control = <RecvMsgManaged<C, S> as OpCode>::Control

Source§

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

Available on io_uring only.
Source§

impl<S1, S2, D, F> OpCode for AsyncifyFd2<S1, S2, F, D>
where S1: Sync, S2: Sync, D: Send + 'static, F: FnOnce(&S1, &S2) -> BufResult<usize, D> + Send + 'static,

Available on io_uring only.
Source§

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

Source§

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

Source§

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

Source§

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

Available on io_uring only.
Source§

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

Source§

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

Source§

type Control = <AcceptMulti<S> as OpCode>::Control

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Control = <FileStat<S> as OpCode>::Control

Source§

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

Source§

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

Source§

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

Source§

type Control = <PathStat<S> as OpCode>::Control

Source§

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

Source§

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

Source§

type Control = <ReadManaged<S> as OpCode>::Control

Source§

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

Source§

type Control = <ReadManagedAt<S> as OpCode>::Control

Source§

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

Source§

type Control = <ReadMulti<S> as OpCode>::Control

Source§

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

Source§

type Control = <ReadMultiAt<S> as OpCode>::Control

Source§

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

Source§

type Control = <RecvFromManaged<S> as OpCode>::Control

Source§

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

Source§

type Control = <RecvFromMulti<S> as OpCode>::Control

Source§

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

Source§

type Control = <RecvManaged<S> as OpCode>::Control

Source§

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

Source§

type Control = <RecvMsgMulti<S> as OpCode>::Control

Source§

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

Source§

type Control = <RecvMulti<S> as OpCode>::Control

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Control = SendMsgControl

Source§

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

Source§

type Control = <SendToZc<T, S> as OpCode>::Control

Source§

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

Source§

type Control = <SendZc<T, S> as OpCode>::Control

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§

type Control = RecvMsgControl

Source§

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

Source§

type Control = SendMsgControl

Source§

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

Source§

type Control = <SendMsgZc<T, C, S> as OpCode>::Control

Source§

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

Source§

type Control = SendMsgControl

Source§

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

Source§

type Control = <SendToVectoredZc<T, S> as OpCode>::Control

Source§

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

Source§

type Control = SendVectoredControl

Source§

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

Source§

type Control = <SendVectoredZc<T, S> as OpCode>::Control

Source§

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

Source§

type Control = VectoredControl

Source§

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

Source§

type Control = VectoredControl

Source§

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

Source§

type Control = RecvMsgControl

Source§

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

Source§

type Control = VectoredControl

Source§

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

Source§

type Control = VectoredControl

Source§

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

Source§

type Control = RecvMsgControl

Source§

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

Source§

type Control = RecvVectoredControl