[−][src]Trait async_spawner::Executor
Trait abstracting over an executor.
Required methods
pub fn block_on(
&self,
future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>
)
[src]
&self,
future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>
)
Blocks until the future has finished.
pub fn spawn(
&self,
future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>
[src]
&self,
future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>
Spawns an asynchronous task using the underlying executor.
pub fn spawn_blocking(
&self,
task: Box<dyn FnOnce() + Send>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>
[src]
&self,
task: Box<dyn FnOnce() + Send>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>
Runs the provided closure on a thread, which can execute blocking tasks asynchronously.
pub fn spawn_local(
&self,
future: Pin<Box<dyn Future<Output = ()> + 'static>>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>
[src]
&self,
future: Pin<Box<dyn Future<Output = ()> + 'static>>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>
Spawns a future that doesn't implement Send.
The spawned future will be executed on the same thread that called spawn_local
.