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

source

fn new() -> Result<UringReactor>

source

fn runs_tasks_on_current_thread(&self) -> bool

source

fn get_result( &self, token: &WakerToken, cx: &mut Context<'_> ) -> Option<Result<u32>>

source

fn cancel_operation(&self, token: WakerToken)

source

pub(crate) fn register_source<F: AsRawDescriptor>( &self, raw: &Arc<RawExecutor<UringReactor>>, fd: &F ) -> Result<RegisteredSource>

source

fn deregister_source(&self, source: &RegisteredSource)

source

fn submit_poll( &self, source: &RegisteredSource, events: EventType ) -> Result<WakerToken>

source

fn submit_fallocate( &self, source: &RegisteredSource, offset: u64, len: u64, mode: u32 ) -> Result<WakerToken>

source

fn submit_cancel_async(&self, token: usize) -> Result<WakerToken>

source

fn submit_fsync(&self, source: &RegisteredSource) -> Result<WakerToken>

source

fn submit_read_to_vectored( &self, source: &RegisteredSource, mem: Arc<dyn BackingMemory + Send + Sync>, offset: Option<u64>, addrs: impl IntoIterator<Item = MemRegion> ) -> Result<WakerToken>

source

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

source§

fn as_raw_descriptor(&self) -> RawDescriptor

Returns the underlying raw descriptor. Read more
source§

impl Drop for UringReactor

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Reactor for UringReactor

source§

fn new() -> Result<Self>

source§

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>>

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)

Called when an executor run loop starts on a thread.
source§

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 more
source§

fn new_source<F: AsRawDescriptor>( &self, ex: &Arc<RawExecutor<Self>>, f: F ) -> AsyncResult<IoSource<F>>

Create an IoSource for the backend.
source§

fn wrap_task_handle<R>(task: RawTaskHandle<UringReactor, R>) -> TaskHandle<R>

source§

impl WeakWake for UringReactor

source§

fn wake_by_ref(weak_self: &Weak<Self>)

source§

fn wake(weak_self: Weak<Self>)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsRawDescriptors for T
where T: AsRawDescriptor,

§

fn as_raw_descriptors(&self) -> Vec<i32>

Returns the underlying raw descriptors. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.