manuel-woelker / rust-vfs

A virtual filesystem for Rust
Apache License 2.0
384 stars 44 forks source link

Add `Send` to trait objects returned from APIs, for interoperability with async code #40

Closed Property404 closed 2 years ago

Property404 commented 2 years ago

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 commented 2 years ago

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.