dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.84k stars 85 forks source link

Feature: Adding Sync bound on Future #248

Closed Mubelotix closed 1 year ago

Mubelotix commented 1 year ago

I need a trait method to return a Future of this kind:

Pin<Box<dyn Future<Output = ...> + Send + Sync + 'static>>

but all I'm able to obtain with this library is

Pin<Box<dyn Future<Output = ...> + Send + 'static>>

Would it be possible to make the library able to add this Sync bound optionally?

We could use this syntax:

#[async_trait(Sync)]

If you think this would be relevant, I'm willing to work on implementing this

Mubelotix commented 1 year ago

Related to #142

dtolnay commented 1 year ago

This is a duplicate of #77. It's not supported by this crate.