Enum fuse_backend_rs::common::async_runtime::Runtime
source · pub enum Runtime {
Tokio(Runtime),
Uring(Mutex<Runtime>),
}
Expand description
An adapter enum to support both tokio current-thread Runtime and tokio-uring Runtime.
Variants§
Implementations§
source§impl Runtime
impl Runtime
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of async Runtime.
A tokio-uring::Runtime
is create if io-uring is available, otherwise a tokio current
thread Runtime will be created.
Panic
Panic if failed to create the Runtime object.
sourcepub fn spawn<T: Future + 'static>(&self, task: T) -> JoinHandle<T::Output>
pub fn spawn<T: Future + 'static>(&self, task: T) -> JoinHandle<T::Output>
Spawns a new asynchronous task, returning a JoinHandle
for it.
Spawning a task enables the task to execute concurrently to other tasks. There is no guarantee that a spawned task will execute to completion. When a runtime is shutdown, all outstanding tasks are dropped, regardless of the lifecycle of that task.
This function must be called from the context of a tokio-uring
runtime.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more