Skip to content

Commit d652b38

Browse files
authored
fix: add Send trait to stderr & stdout of ExecResult (#809)
Solves: #808 This has been locally tested and confirmed to solve the issue. It passes `cargo t` locally.
1 parent ef09f04 commit d652b38

File tree

2 files changed

+4
-4
lines changed
  • testcontainers/src/core/containers

2 files changed

+4
-4
lines changed

testcontainers/src/core/containers/async_container/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ impl ExecResult {
2323
}
2424

2525
/// Returns an asynchronous reader for stdout. It follows log stream until the command exits.
26-
pub fn stdout<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + 'b>> {
26+
pub fn stdout<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + Send + 'b>> {
2727
Box::pin(tokio_util::io::StreamReader::new(&mut self.stdout))
2828
}
2929

3030
/// Returns an asynchronous reader for stderr. It follows log stream until the command exits.
31-
pub fn stderr<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + 'b>> {
31+
pub fn stderr<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + Send + 'b>> {
3232
Box::pin(tokio_util::io::StreamReader::new(&mut self.stderr))
3333
}
3434

testcontainers/src/core/containers/sync_container/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ impl SyncExecResult {
1919
}
2020

2121
/// Returns an asynchronous reader for stdout.
22-
pub fn stdout<'b>(&'b mut self) -> Box<dyn BufRead + 'b> {
22+
pub fn stdout<'b>(&'b mut self) -> Box<dyn BufRead + Send + 'b> {
2323
Box::new(sync_reader::SyncReadBridge::new(
2424
self.inner.stdout(),
2525
self.runtime.clone(),
2626
))
2727
}
2828

2929
/// Returns an asynchronous reader for stderr.
30-
pub fn stderr<'b>(&'b mut self) -> Box<dyn BufRead + 'b> {
30+
pub fn stderr<'b>(&'b mut self) -> Box<dyn BufRead + Send + 'b> {
3131
Box::new(sync_reader::SyncReadBridge::new(
3232
self.inner.stderr(),
3333
self.runtime.clone(),

0 commit comments

Comments
 (0)