diff --git a/src/generic_wrap.rs b/src/generic_wrap.rs index 00551d3..547aaeb 100644 --- a/src/generic_wrap.rs +++ b/src/generic_wrap.rs @@ -167,7 +167,7 @@ macro_rules! Wrap { /// #[derive(Debug)] /// pub struct YourWrapper; #[doc = concat!("impl ", stringify!($wrapper), " for YourWrapper {}\n```")] - pub trait $wrapper: ::std::fmt::Debug { + pub trait $wrapper: ::std::fmt::Debug + Send + Sync { /// Called on a first instance if a second of the same type is added. /// /// Only one of a wrapper type can exist within a Wrap at a time. The default behaviour diff --git a/src/tokio/core.rs b/src/tokio/core.rs index 8ed3311..9a46499 100644 --- a/src/tokio/core.rs +++ b/src/tokio/core.rs @@ -109,7 +109,7 @@ pub trait TokioChildWrapper: std::fmt::Debug + Send + Sync { /// By default this calls `start_kill()` and then `wait()`, which is the same way it is done on /// the underlying `Child`, but that way implementing either or both of those methods will use /// them when calling `kill()`, instead of requiring a stub implementation. - fn kill(&mut self) -> Box> + '_> { + fn kill(&mut self) -> Box> + Send + '_> { Box::new(async { self.start_kill()?; Box::into_pin(self.wait()).await?; @@ -142,7 +142,7 @@ pub trait TokioChildWrapper: std::fmt::Debug + Send + Sync { /// has exited will always return the same result. /// /// By default this is a passthrough to the underlying `Child`. - fn wait(&mut self) -> Box> + '_> { + fn wait(&mut self) -> Box> + Send + '_> { Box::new(self.inner_mut().wait()) } @@ -152,7 +152,7 @@ pub trait TokioChildWrapper: std::fmt::Debug + Send + Sync { /// /// By default this is a reimplementation of the Tokio method, so that it can use the wrapper's /// `wait()` method instead of the underlying `Child`'s `wait()`. - fn wait_with_output(mut self: Box) -> Box>> + fn wait_with_output(mut self: Box) -> Box> + Send> where Self: 'static, { diff --git a/src/tokio/process_group.rs b/src/tokio/process_group.rs index deb29ae..de7bc04 100644 --- a/src/tokio/process_group.rs +++ b/src/tokio/process_group.rs @@ -191,7 +191,7 @@ impl TokioChildWrapper for ProcessGroupChild { } #[instrument(level = "debug", skip(self))] - fn wait(&mut self) -> Box> + '_> { + fn wait(&mut self) -> Box> + Send + '_> { Box::new(async { if let ChildExitStatus::Exited(status) = &self.exit_status { return Ok(*status);