pub struct AsyncRuntime { /* private fields */ }Implementations§
Source§impl AsyncRuntime
impl AsyncRuntime
Sourcepub fn block_in_place_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
pub fn block_in_place_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
Forcibly blocks this thread to evaluate the given future. This can be dangerous and lead to deadlocks if called re-entrantly on an async worker thread as the entire thread pool can end up blocking, leading to a deadlock. If you want to prevent this use block_on, which will panic if called from an async thread.
Sourcepub fn block_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
pub fn block_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
Blocks this thread to evaluate the given future. Panics if the current thread is an async runtime worker thread.
Sourcepub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
pub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
Spawns a future onto the Tokio runtime (see [tokio::runtime::Runtime::spawn]).
pub fn spawn_blocking<F, R>(&self, f: F) -> JoinHandle<R>
Auto Trait Implementations§
impl !Freeze for AsyncRuntime
impl RefUnwindSafe for AsyncRuntime
impl Send for AsyncRuntime
impl Sync for AsyncRuntime
impl Unpin for AsyncRuntime
impl UnsafeUnpin for AsyncRuntime
impl UnwindSafe for AsyncRuntime
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more