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§
Required Methods§
Sourcefn create_entry(&mut self, _: &mut Self::Control) -> OpEntry
fn create_entry(&mut self, _: &mut Self::Control) -> OpEntry
Create submission entry.
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.
Sourcefn create_entry_fallback(&mut self, _: &mut Self::Control) -> OpEntry
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.
Sourcefn call_blocking(&mut self, _: &mut Self::Control) -> Result<usize>
fn call_blocking(&mut self, _: &mut Self::Control) -> Result<usize>
Call the operation in a blocking way. This method will be called if
create_entryreturnsOpEntry::Blocking.create_entryreturns an entry with unsupported opcode, andcreate_entry_fallbackreturnsOpEntry::Blocking.create_entryandcreate_entry_fallbackboth return an entry with unsupported opcode.
Sourceunsafe fn set_result(
&mut self,
_: &mut Self::Control,
_: &Result<usize>,
_: &Extra,
)
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.
Implementors§
Source§impl<S1, S2, D, F> OpCode for AsyncifyFd2<S1, S2, F, D>
Available on io_uring only.
impl<S1, S2, D, F> OpCode for AsyncifyFd2<S1, S2, F, D>
Available on
io_uring only.Source§impl<S, D, F> OpCode for AsyncifyFd<S, F, D>
Available on io_uring only.
impl<S, D, F> OpCode for AsyncifyFd<S, F, D>
Available on
io_uring only.