pub struct AsyncStd;
Expand description

An executor that spawns tasks on async-std. In contrast to the other executors, this one is not self contained, because async-std does not provide an API that allows that, so the threadpool is global.

It works on Wasm.

Implementations

Create a new AsyncStd wrapper, forwards to Default::default.

Wrapper around async_std::task::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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Spawns a future that will be run to completion. Read more

Determines whether the executor is able to spawn new tasks. Read more

Spawn a future and return a JoinHandle that can be awaited for the output of the future.

Spawns a future that will be run to completion. Read more

Determines whether the executor is able to spawn new tasks. Read more

Runs the provided closure on a thread where blocking is acceptable.

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

Spawn a future and return a JoinHandle that can be awaited for the output of the future.

Future that resolves after a given duration.

Await this future in order to yield to the executor.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.