pub type BoxFuture<T> = Pin<Box<dyn Future<Output = T> + Send + 'static>>;Available on crate feature
std only.Expand description
Boxed, owned, Send future of unit output — the shape Runtime::spawn
and Runtime::sleep work in.
'static lifetime because spawned futures outlive any borrow at the
call site; Send because the default tokio impl is multi-threaded and
the futures cross thread boundaries. On the single-threaded WASM / WASI
impls the Send bound is harmless — a single-threaded executor still
accepts Send futures.
Aliased Type§
pub struct BoxFuture<T> { /* private fields */ }