pub struct TokioSpawner;
Available on crate feature
tokio
only.Expand description
A AsyncSpawner
that uses the tokio
runtime.
Trait Implementations§
Source§impl AsyncAfterSpawner for TokioSpawner
impl AsyncAfterSpawner for TokioSpawner
Source§type JoinHandle<F: Send + 'static> = TokioAfterHandle<F>
type JoinHandle<F: Send + 'static> = TokioAfterHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn_after<F>(
duration: Duration,
future: F,
) -> <TokioSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_after<F>( duration: Duration, future: F, ) -> <TokioSpawner 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,
) -> <TokioSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_after_at<F>( instant: Instant, future: F, ) -> <TokioSpawner 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 TokioSpawner
impl AsyncBlockingSpawner for TokioSpawner
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,
) -> <TokioSpawner as AsyncBlockingSpawner>::JoinHandle<R>
fn spawn_blocking<F, R>( _f: F, ) -> <TokioSpawner as AsyncBlockingSpawner>::JoinHandle<R>
Spawn a blocking function onto the runtime
Source§impl AsyncLocalAfterSpawner for TokioSpawner
impl AsyncLocalAfterSpawner for TokioSpawner
Source§type JoinHandle<F: 'static> = TokioAfterHandle<F>
type JoinHandle<F: 'static> = TokioAfterHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn_local_after<F>(
duration: Duration,
future: F,
) -> <TokioSpawner as AsyncLocalAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local_after<F>( duration: Duration, future: F, ) -> <TokioSpawner 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,
) -> <TokioSpawner as AsyncLocalAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local_after_at<F>( instant: Instant, future: F, ) -> <TokioSpawner 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 TokioSpawner
impl AsyncLocalSpawner for TokioSpawner
Source§type JoinHandle<F: 'static> = JoinHandle<F>
type JoinHandle<F: 'static> = JoinHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn_local<F>(
future: F,
) -> <TokioSpawner as AsyncLocalSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local<F>( future: F, ) -> <TokioSpawner as AsyncLocalSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future.
Source§impl AsyncSpawner for TokioSpawner
impl AsyncSpawner for TokioSpawner
Source§type JoinHandle<F: Send + 'static> = JoinHandle<F>
type JoinHandle<F: Send + 'static> = JoinHandle<F>
The handle returned by the spawner when a future is spawned.
Source§fn spawn<F>(
future: F,
) -> <TokioSpawner as AsyncSpawner>::JoinHandle<<F as Future>::Output>
fn spawn<F>( future: F, ) -> <TokioSpawner as AsyncSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future.
Source§impl Clone for TokioSpawner
impl Clone for TokioSpawner
Source§fn clone(&self) -> TokioSpawner
fn clone(&self) -> TokioSpawner
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 TokioSpawner
impl Debug for TokioSpawner
Source§impl Yielder for TokioSpawner
impl Yielder for TokioSpawner
impl Copy for TokioSpawner
Auto Trait Implementations§
impl Freeze for TokioSpawner
impl RefUnwindSafe for TokioSpawner
impl Send for TokioSpawner
impl Sync for TokioSpawner
impl Unpin for TokioSpawner
impl UnwindSafe for TokioSpawner
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