diff --git a/src/imageproxy.rs b/src/imageproxy.rs index bd6b2f6..f9243d9 100644 --- a/src/imageproxy.rs +++ b/src/imageproxy.rs @@ -132,7 +132,10 @@ struct Reply { } type ChildFuture = Pin< - Box, JoinError>>>, + Box< + dyn Future, JoinError>> + + Send, + >, >; /// Manage a child process proxy to fetch container images. @@ -718,4 +721,20 @@ mod tests { Err(e) => panic!("Unexpected error {e}"), } } + + #[tokio::test] + async fn test_proxy_send_sync() { + fn assert_send_sync(_x: impl Send + Sync) {} + + let Ok(proxy) = ImageProxy::new().await else { + // doesn't matter: we only actually care to test if this compiles + return; + }; + assert_send_sync(&proxy); + assert_send_sync(proxy); + + let opened = OpenedImage(0); + assert_send_sync(&opened); + assert_send_sync(opened); + } }