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

Add a feature "send" to provide an Send ArchiveWriter #122

Merged
merged 5 commits into from Jul 11, 2022
Merged

Conversation

commial
Copy link
Contributor

@commial commial commented May 12, 2022

Fix #120

This PR:

  • replace the inner type and trait of LayerArchiveWriter with aliases
  • introduce a feature send for MLA, disabled by default, which make ArchiveWriter<W> Send
  • add a test checking that ArchiveWriter is actually Send when the feature is on

When the feature is on, the W type must be Send.

Forcing Send on the InnerWriterType could have been a simpler way. But it also force the user-provided type to be Sent.
Indeed, the last layer (RawLayer) can't be Send if its inner type (W, the user-provided one) is not Send.

The feature mitigates this behavior: it does not require the W type to be Send, unless the user actually need ArchiveWriter to be Send.

This behavior could have been obtain with an unsafe statement, but I'm trying to avoid them in MLA.

@sashaconway sashaconway merged commit 9346e67 into master Jul 11, 2022
@sashaconway sashaconway deleted the mla-send branch July 11, 2022 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make MLA Send
2 participants