pub struct IoInitiator { /* private fields */ }
Expand description
Client handle for initiating IOs or spawning tasks on a specific threadpool thread.
Implementations§
Source§impl IoInitiator
impl IoInitiator
Sourcepub async unsafe fn issue_io<T, F>(&self, io_mem: T, f: F) -> (Result<i32>, T)
pub async unsafe fn issue_io<T, F>(&self, io_mem: T, f: F) -> (Result<i32>, T)
Issues an IO described by f
, referencing IO memory in io_mem
.
The submission queue entry for the IO is provided by f
so that the IO
can reference memory in the io_mem
object. A reference to io_mem
is
passed to f
after it has been pinned in memory so that it will not
move for the lifetime of the IO.
Once the IO has completed, both the result and the IO memory are returned.
§Safety
The caller must guarantee that f
returns a submission queue entry that
only references memory of static lifetime or that is part of the
io_mem
object passed to f
.
§Aborts
The process will abort if the async function is dropped before it
completes. This is because the IO memory is not moved into the heap, and
drop
cannot synchronously wait for the IO to complete.
Trait Implementations§
Source§impl Clone for IoInitiator
impl Clone for IoInitiator
Source§fn clone(&self) -> IoInitiator
fn clone(&self) -> IoInitiator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more