pub struct WasmSpawner;
Expand description
A AsyncSpawner
that uses the wasm-bindgen-futures
runtime.
Trait Implementations§
Source§impl AsyncAfterSpawner for WasmSpawner
impl AsyncAfterSpawner for WasmSpawner
Source§type JoinHandle<F: Send + 'static> = WasmAfterHandle<F>
type JoinHandle<F: Send + 'static> = WasmAfterHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn_after<F>(
duration: Duration,
future: F,
) -> <WasmSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_after<F>( duration: Duration, future: F, ) -> <WasmSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime and run the given future after the given duration
Source§fn spawn_after_at<F>(
instant: Instant,
future: F,
) -> <WasmSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_after_at<F>( instant: Instant, future: F, ) -> <WasmSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime and run the given future after reach the given instant
Source§fn spawn_after_detach<F>(duration: Duration, future: F)
fn spawn_after_detach<F>(duration: Duration, future: F)
Spawn and detach a future onto the runtime and run the given future after the given duration
Source§impl AsyncBlockingSpawner for WasmSpawner
impl AsyncBlockingSpawner for WasmSpawner
Source§type JoinHandle<R: Send + 'static> = JoinHandle<R>
type JoinHandle<R: Send + 'static> = JoinHandle<R>
The join handle type for blocking tasks
Source§fn spawn_blocking<F, R>(
f: F,
) -> <WasmSpawner as AsyncBlockingSpawner>::JoinHandle<R>
fn spawn_blocking<F, R>( f: F, ) -> <WasmSpawner as AsyncBlockingSpawner>::JoinHandle<R>
Spawn a blocking function onto the runtime
Source§impl AsyncLocalAfterSpawner for WasmSpawner
impl AsyncLocalAfterSpawner for WasmSpawner
Source§type JoinHandle<F: 'static> = WasmAfterHandle<F>
type JoinHandle<F: 'static> = WasmAfterHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn_local_after<F>(
duration: Duration,
future: F,
) -> <WasmSpawner as AsyncLocalAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local_after<F>( duration: Duration, future: F, ) -> <WasmSpawner as AsyncLocalAfterSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime and run the given future after the given duration
Source§fn spawn_local_after_at<F>(
instant: Instant,
future: F,
) -> <WasmSpawner as AsyncLocalAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local_after_at<F>( instant: Instant, future: F, ) -> <WasmSpawner as AsyncLocalAfterSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime and run the given future after reach the given instant
Source§fn spawn_local_after_detach<F>(duration: Duration, future: F)
fn spawn_local_after_detach<F>(duration: Duration, future: F)
Spawn and detach a future onto the runtime and run the given future after the given duration
Source§impl AsyncLocalSpawner for WasmSpawner
impl AsyncLocalSpawner for WasmSpawner
Source§type JoinHandle<F: 'static> = WasmJoinHandle<F>
type JoinHandle<F: 'static> = WasmJoinHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn_local<F>(
future: F,
) -> <WasmSpawner as AsyncLocalSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local<F>( future: F, ) -> <WasmSpawner as AsyncLocalSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future.
Source§impl AsyncSpawner for WasmSpawner
impl AsyncSpawner for WasmSpawner
Source§type JoinHandle<F: Send + 'static> = WasmJoinHandle<F>
type JoinHandle<F: Send + 'static> = WasmJoinHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn<F>(
future: F,
) -> <WasmSpawner as AsyncSpawner>::JoinHandle<<F as Future>::Output>
fn spawn<F>( future: F, ) -> <WasmSpawner as AsyncSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future.
Source§impl Clone for WasmSpawner
impl Clone for WasmSpawner
Source§fn clone(&self) -> WasmSpawner
fn clone(&self) -> WasmSpawner
Returns a copy 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 WasmSpawner
impl Debug for WasmSpawner
Source§impl Yielder for WasmSpawner
impl Yielder for WasmSpawner
impl Copy for WasmSpawner
Auto Trait Implementations§
impl Freeze for WasmSpawner
impl RefUnwindSafe for WasmSpawner
impl Send for WasmSpawner
impl Sync for WasmSpawner
impl Unpin for WasmSpawner
impl UnwindSafe for WasmSpawner
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