pub struct Runtime { /* private fields */ }Expand description
The Runtime Executor
This is the Runtime for tokio-uring.
It wraps the default Runtime using the platform-specific Driver.
This executes futures and tasks within the current-thread only.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new(b: &Builder) -> Result<Runtime>
pub fn new(b: &Builder) -> Result<Runtime>
Creates a new tokio_uring runtime on the current thread.
This takes the tokio-uring Builder as a parameter.
Sourcepub fn block_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
pub fn block_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
Runs a future to completion on the tokio-uring runtime. This is the runtime’s entry point.
This runs the given future on the current thread, blocking until it is complete, and yielding its resolved result. Any tasks, futures, or timers which the future spawns internally will be executed on this runtime.
Any spawned tasks will be suspended after block_on returns. Calling
block_on again will resume previously spawned tasks.
§Panics
This function panics if the provided future panics, or if called within an asynchronous execution context. Runs a future to completion on the current runtime.