You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that, due to Box<dyn> usage of ArchiveWriter and ArchiveReader, these structures are unable to auto-derive the Send trait.
Here a some of the possibles solutions:
Realize that the Box<dyn Layer> is too generic, and that actually only a few Layers exist. The Box can then be replaced with an enum of possible layer, hopefully giving enough hint to the compiler to auto-derive Send
Pro: auto-derive of the trait ; might simplify the code
Con: likely avoid other crates to add custom Layer (actually not feasible for now due to crate visibility) ; code refactoring needed
Explicit Send implementation
Pro: small changes to the current code base
Con: unsafe code ; some care must be taken to ensure no unwanted behavior is added. For instance, what if the inner Write is not Send?
Like 2., but explicit Send for each layer separately to be more conservative
Pro: might limits unwanted effects
Con: as 2. + might not be enough ; more change are required
The text was updated successfully, but these errors were encountered:
Send
is a trait usually auto-derive.It seems that, due to
Box<dyn>
usage ofArchiveWriter
andArchiveReader
, these structures are unable to auto-derive theSend
trait.Here a some of the possibles solutions:
Box<dyn Layer>
is too generic, and that actually only a few Layers exist. TheBox
can then be replaced with anenum
of possible layer, hopefully giving enough hint to the compiler to auto-deriveSend
Send
implementationunsafe
code ; some care must be taken to ensure no unwanted behavior is added. For instance, what if the innerWrite
is notSend
?Send
for each layer separately to be more conservativeThe text was updated successfully, but these errors were encountered: