Runtime

Struct Runtime 

Source
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

Source

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.

Source

pub fn block_on<F>(&self, future: F) -> F::Output
where 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.

Trait Implementations§

Source§

impl Drop for Runtime

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !Freeze for Runtime

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 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>,

Source§

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

Source§

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.