Struct cros_async::sys::unix::uring_executor::UringReactor
source · pub struct UringReactor {
ctx: URingContext,
ring: Mutex<Ring>,
thread_id: Mutex<Option<ThreadId>>,
}
Expand description
Reactor
that manages async IO work using io_uring.
Fields§
§ctx: URingContext
§ring: Mutex<Ring>
§thread_id: Mutex<Option<ThreadId>>
Implementations§
source§impl UringReactor
impl UringReactor
fn new() -> Result<UringReactor>
fn runs_tasks_on_current_thread(&self) -> bool
fn get_result(
&self,
token: &WakerToken,
cx: &mut Context<'_>
) -> Option<Result<u32>>
fn cancel_operation(&self, token: WakerToken)
pub(crate) fn register_source<F: AsRawDescriptor>(
&self,
raw: &Arc<RawExecutor<UringReactor>>,
fd: &F
) -> Result<RegisteredSource>
fn deregister_source(&self, source: &RegisteredSource)
fn submit_poll(
&self,
source: &RegisteredSource,
events: EventType
) -> Result<WakerToken>
fn submit_fallocate(
&self,
source: &RegisteredSource,
offset: u64,
len: u64,
mode: u32
) -> Result<WakerToken>
fn submit_cancel_async(&self, token: usize) -> Result<WakerToken>
fn submit_fsync(&self, source: &RegisteredSource) -> Result<WakerToken>
fn submit_read_to_vectored(
&self,
source: &RegisteredSource,
mem: Arc<dyn BackingMemory + Send + Sync>,
offset: Option<u64>,
addrs: impl IntoIterator<Item = MemRegion>
) -> Result<WakerToken>
fn submit_write_from_vectored(
&self,
source: &RegisteredSource,
mem: Arc<dyn BackingMemory + Send + Sync>,
offset: Option<u64>,
addrs: impl IntoIterator<Item = MemRegion>
) -> Result<WakerToken>
Trait Implementations§
source§impl AsRawDescriptor for UringReactor
impl AsRawDescriptor for UringReactor
source§fn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Returns the underlying raw descriptor. Read more
source§impl Drop for UringReactor
impl Drop for UringReactor
source§impl Reactor for UringReactor
impl Reactor for UringReactor
fn new() -> Result<Self>
source§fn wake(&self)
fn wake(&self)
Wake up any pending
wait_for_work
calls. If there are none pending, then wake up the next
wait_for_work
call (necessary to avoid race conditions).source§fn on_executor_drop<'a>(&'a self) -> Pin<Box<dyn Future<Output = ()> + 'a>>
fn on_executor_drop<'a>(&'a self) -> Pin<Box<dyn Future<Output = ()> + 'a>>
Called when the executor is being dropped to allow orderly shutdown (e.g. cancelling IO
work). The returned future will be run to completion. Read more
source§fn on_thread_start(&self)
fn on_thread_start(&self)
Called when an executor run loop starts on a thread.
source§fn wait_for_work(&self, set_processing: impl Fn()) -> Result<()>
fn wait_for_work(&self, set_processing: impl Fn()) -> Result<()>
Block until an event occurs (e.g. IO work is ready) or until
wake
is called. Read moresource§fn new_source<F: AsRawDescriptor>(
&self,
ex: &Arc<RawExecutor<Self>>,
f: F
) -> AsyncResult<IoSource<F>>
fn new_source<F: AsRawDescriptor>(
&self,
ex: &Arc<RawExecutor<Self>>,
f: F
) -> AsyncResult<IoSource<F>>
Create an
IoSource
for the backend.