diff --git a/tokio-executor/src/lib.rs b/tokio-executor/src/lib.rs index 220a66f1b..d08b5b618 100644 --- a/tokio-executor/src/lib.rs +++ b/tokio-executor/src/lib.rs @@ -182,6 +182,25 @@ pub trait Executor { } } +impl Executor for Box { + fn spawn(&mut self, future: Box + Send>) + -> Result<(), SpawnError> + { + (**self).spawn(future) + } + + #[cfg(feature = "unstable-futures")] + fn spawn2(&mut self, future: Box + Send>) + -> Result<(), futures2::executor::SpawnError> + { + (**self).spawn2(future) + } + + fn status(&self) -> Result<(), SpawnError> { + (**self).status() + } +} + /// Errors returned by `Executor::spawn`. /// /// Spawn errors should represent relatively rare scenarios. Currently, the two