Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MLA Send #120

commial opened this issue Mar 17, 2022 · 0 comments · Fixed by #122

Make MLA Send #120

commial opened this issue Mar 17, 2022 · 0 comments · Fixed by #122
enhancement New feature or request


Copy link

commial commented Mar 17, 2022

Send is a trait usually auto-derive.

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:

  1. 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
  1. 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?
  1. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
enhancement New feature or request
None yet

Successfully merging a pull request may close this issue.

1 participant