pub struct WasmSpawner;
Available on crate feature
wasm
only.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more