pub unsafe trait IourOpCode {
// Required method
fn create_entry(self: Pin<&mut Self>) -> OpEntry;
// Provided methods
fn create_entry_fallback(self: Pin<&mut Self>) -> OpEntry { ... }
fn call_blocking(self: Pin<&mut Self>) -> Result<usize, Error> { ... }
unsafe fn set_result(
self: Pin<&mut Self>,
_: &Result<usize, Error>,
_: &Extra,
) { ... }
unsafe fn push_multishot(
self: Pin<&mut Self>,
_: Result<usize, Error>,
_: Extra,
) { ... }
fn pop_multishot(self: Pin<&mut Self>) -> 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 Methods§
Sourcefn create_entry(self: Pin<&mut Self>) -> OpEntry
fn create_entry(self: Pin<&mut Self>) -> OpEntry
Create submission entry.
Provided Methods§
Sourcefn create_entry_fallback(self: Pin<&mut Self>) -> OpEntry
fn create_entry_fallback(self: Pin<&mut Self>) -> OpEntry
Create submission entry for fallback. This method will only be called if
create_entry returns an entry with unsupported opcode.
Sourcefn call_blocking(self: Pin<&mut Self>) -> Result<usize, Error>
fn call_blocking(self: Pin<&mut Self>) -> Result<usize, Error>
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(self: Pin<&mut Self>, _: &Result<usize, Error>, _: &Extra)
unsafe fn set_result(self: Pin<&mut Self>, _: &Result<usize, Error>, _: &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.