dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.81k stars 84 forks source link

Support the impl Future syntax #274

Closed Sytten closed 10 hours ago

Sytten commented 1 month ago

Hi!

The crate that was promised to patch the limitations of 1.75 async trait fn (trait-variant) never took off and was never finished.

This leaves library developers that want to support both boxed and non-boxed futures in messy state since most need to do the impl Future to get the Send bound and thus can't use async-trait.

I am wondering if async-trait could support the return impl Future<Output = ...> + Send syntaxt to help in the transition? Or would that be a breaking change / not something you would want. Even just basic support would already be a huge improvements.

Thanks

dtolnay commented 10 hours ago

I would prefer not to support that in this crate.

Sytten commented 8 hours ago

Fair enough, kinda annoying that we are stuck in this state. There really no good solution to this problem right now.