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 Send to trait objects returned from APIs, for interoperability with async code #40

Merged

Conversation

Property404
Copy link
Contributor

@Property404 Property404 commented Nov 25, 2022

Previously, these APIs would return a trait object not marked Send, which made it difficult to use in an async context.

Adding 'Send' requires very little modification (though I think this should still be a major version bump because it affects a public trait) and greatly improves usability for async code.

@manuel-woelker
Copy link
Owner

Thanks for the PR! Looking good.

A potential drawback I see is the following: VFS implementations would now be required to return Sendable results. I'm trying to figure out if that would exclude any useful future implementations.

open_file/create_file/append_file

Previously, these APIs would return a trait object not marked Send,
which made it difficult to use in an async context.

Adding 'Send' requires very little modification and greatly improves
usability for async code.
@manuel-woelker manuel-woelker merged commit a406210 into manuel-woelker:master Dec 1, 2022
@Property404 Property404 deleted the Property404/open-as-send branch December 18, 2022 18:04
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.

2 participants