pub struct GlobalExecutor;
Expand description
Executor that switches between TokioExecutor
, ThreadpoolExecutor
and WasmExecutor
at compile time.
- If the target is non-wasm32 and the “tokio” feature is enabled,
tokio
would be used. - if the target is non-wasm32 and the “threadpool” feature is enabled with
tokio
feature disabled,futures
ThreadPool
will be used. - If the target is wasm32, [
wasm-bindgen-futures
] would be used.
Trait Implementations§
Source§impl Clone for GlobalExecutor
impl Clone for GlobalExecutor
Source§fn clone(&self) -> GlobalExecutor
fn clone(&self) -> GlobalExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GlobalExecutor
impl Debug for GlobalExecutor
Source§impl Executor for GlobalExecutor
impl Executor for GlobalExecutor
Source§fn spawn<F>(&self, future: F) -> JoinHandle<F::Output> ⓘ
fn spawn<F>(&self, future: F) -> JoinHandle<F::Output> ⓘ
Spawns a new asynchronous task in the background, returning a Future
JoinHandle
for it.Source§fn spawn_abortable<F>(&self, future: F) -> AbortableJoinHandle<F::Output> ⓘ
fn spawn_abortable<F>(&self, future: F) -> AbortableJoinHandle<F::Output> ⓘ
Spawns a new asynchronous task in the background, returning an abortable handle that will cancel the task
once the handle is dropped. Read more
Source§fn dispatch<F>(&self, future: F)
fn dispatch<F>(&self, future: F)
Spawns a new asynchronous task in the background without an handle.
Basically the same as
Executor::spawn
.Source§fn spawn_coroutine<T, F, Fut>(&self, f: F) -> CommunicationTask<T>
fn spawn_coroutine<T, F, Fut>(&self, f: F) -> CommunicationTask<T>
Spawns a new asynchronous task that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§fn spawn_coroutine_with_context<T, F, C, Fut>(
&self,
context: C,
f: F,
) -> CommunicationTask<T>
fn spawn_coroutine_with_context<T, F, C, Fut>( &self, context: C, f: F, ) -> CommunicationTask<T>
Spawns a new asynchronous task with provided context that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§fn spawn_unbounded_coroutine<T, F, Fut>(
&self,
f: F,
) -> UnboundedCommunicationTask<T>
fn spawn_unbounded_coroutine<T, F, Fut>( &self, f: F, ) -> UnboundedCommunicationTask<T>
Spawns a new asynchronous task that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§fn spawn_unbounded_coroutine_with_context<T, F, C, Fut>(
&self,
context: C,
f: F,
) -> UnboundedCommunicationTask<T>
fn spawn_unbounded_coroutine_with_context<T, F, C, Fut>( &self, context: C, f: F, ) -> UnboundedCommunicationTask<T>
Spawns a new asynchronous task with provided context that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§impl PartialEq for GlobalExecutor
impl PartialEq for GlobalExecutor
Source§impl PartialOrd for GlobalExecutor
impl PartialOrd for GlobalExecutor
impl Copy for GlobalExecutor
impl Eq for GlobalExecutor
impl StructuralPartialEq for GlobalExecutor
Auto Trait Implementations§
impl Freeze for GlobalExecutor
impl RefUnwindSafe for GlobalExecutor
impl Send for GlobalExecutor
impl Sync for GlobalExecutor
impl Unpin for GlobalExecutor
impl UnwindSafe for GlobalExecutor
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