feat(body): remove Sync bound for Body::wrap_stream
A stream wrapped into a Body previously needed to implement `Sync` so that the Body type implements this autotrait as well (which is needed due to limitations in async/await). Since a stream only offers one method that is called with an exclusive reference, this type is statically proven to be Sync already. In theory it should be fine to add an `unsafe impl Sync`, but this commit instead adds a SyncWrapper to enlist the compiler’s help in proving that this is (and remains) correct. This makes it easier to construct response bodies for client code.
This commit is contained in:
committed by
Sean McArthur
parent
d5b0ee5672
commit
042c770603
@@ -13,6 +13,7 @@ pub(crate) mod exec;
|
||||
pub(crate) mod io;
|
||||
mod lazy;
|
||||
mod never;
|
||||
pub(crate) mod sync_wrapper;
|
||||
pub(crate) mod task;
|
||||
pub(crate) mod watch;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user