chore: integrate Boxed TaskSpawner (#1356)

This commit is contained in:
Matthias Seitz
2023-02-14 21:44:22 +01:00
committed by GitHub
parent 87ba4840e9
commit f995e66c96
4 changed files with 16 additions and 20 deletions

View File

@ -66,7 +66,7 @@ pub mod shutdown;
/// ```
///
/// The [TaskSpawner] trait is [DynClone] so `Box<dyn TaskSpawner>` are also `Clone`.
pub trait TaskSpawner: Send + Sync + DynClone {
pub trait TaskSpawner: Send + Sync + std::fmt::Debug + DynClone {
/// Spawns the task onto the runtime.
/// See also [`Handle::spawn`].
fn spawn(&self, fut: BoxFuture<'static, ()>) -> JoinHandle<()>;