Struct async_executors::exec::AsyncGlobal [−][src]
pub struct AsyncGlobal;
async_global
only.Expand description
An executor that spawns tasks on async-global-executor. In contrast to the other executors, this one is not self contained, because async-global-executor does not provide an API that allows that, so the threadpool is global.
It works on Wasm.
Implementations
This is supported on non-target_os="unknown"
only.
target_os="unknown"
only.Wrapper around async_global_executor::block_on. This is not available on Wasm as Wasm does not have threads and you’re not allowed to block the only thread you have.
Trait Implementations
Returns the “default value” for a type. Read more
fn spawn_handle_local_obj(
&self,
future: LocalFutureObj<'static, Out>
) -> Result<JoinHandle<Out>, SpawnError>
fn spawn_handle_local_obj(
&self,
future: LocalFutureObj<'static, Out>
) -> Result<JoinHandle<Out>, SpawnError>
Spawn a future and return a JoinHandle
that can be awaited for the output of the future.
fn spawn_blocking<F>(&self, f: F) -> BlockingHandle<R>ⓘNotable traits for BlockingHandle<T>impl<T: 'static> Future for BlockingHandle<T> type Output = T;
where
F: FnOnce() -> R + Send + 'static,
fn spawn_blocking<F>(&self, f: F) -> BlockingHandle<R>ⓘNotable traits for BlockingHandle<T>impl<T: 'static> Future for BlockingHandle<T> type Output = T;
where
F: FnOnce() -> R + Send + 'static,
impl<T: 'static> Future for BlockingHandle<T> type Output = T;
Runs the provided closure on a thread where blocking is acceptable.
fn spawn_blocking_dyn(
&self,
f: Box<dyn FnOnce() -> R + Send>
) -> BlockingHandle<R>ⓘNotable traits for BlockingHandle<T>impl<T: 'static> Future for BlockingHandle<T> type Output = T;
fn spawn_blocking_dyn(
&self,
f: Box<dyn FnOnce() -> R + Send>
) -> BlockingHandle<R>ⓘNotable traits for BlockingHandle<T>impl<T: 'static> Future for BlockingHandle<T> type Output = T;
impl<T: 'static> Future for BlockingHandle<T> type Output = T;
Runs the provided closure on a thread where blocking is acceptable. This part of the trait is object safe but your closure must be boxed and you cannot have a return value. Read more
fn spawn_handle_obj(
&self,
future: FutureObj<'static, Out>
) -> Result<JoinHandle<Out>, SpawnError>
fn spawn_handle_obj(
&self,
future: FutureObj<'static, Out>
) -> Result<JoinHandle<Out>, SpawnError>
Spawn a future and return a JoinHandle
that can be awaited for the output of the future.
fn yield_now(&self) -> YieldNowFutⓘNotable traits for YieldNowFutimpl Future for YieldNowFut type Output = ();
fn yield_now(&self) -> YieldNowFutⓘNotable traits for YieldNowFutimpl Future for YieldNowFut type Output = ();
impl Future for YieldNowFut type Output = ();
Await this future in order to yield to the executor.
impl TokioIo for AsyncGlobal
async_global_tokio
only.Signal io can be used on this executor.
Auto Trait Implementations
impl RefUnwindSafe for AsyncGlobal
impl Send for AsyncGlobal
impl Sync for AsyncGlobal
impl Unpin for AsyncGlobal
impl UnwindSafe for AsyncGlobal
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError> where
Fut: 'static + Future<Output = ()>,
fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError> where
Fut: 'static + Future<Output = ()>,
Spawns a task that polls the given future with output ()
to
completion. Read more
fn spawn_local_with_handle<Fut>(
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: 'static + Future,
fn spawn_local_with_handle<Fut>(
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: 'static + Future,
Spawns a task that polls the given future to completion and returns a future that resolves to the spawned future’s output. Read more
Spawns a task that polls the given future with output ()
to
completion. Read more
fn spawn_with_handle<Fut>(
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: 'static + Future + Send,
<Fut as Future>::Output: Send,
fn spawn_with_handle<Fut>(
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: 'static + Future + Send,
<Fut as Future>::Output: Send,
Spawns a task that polls the given future to completion and returns a future that resolves to the spawned future’s output. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more