slawlor / ractor

Rust actor framework
MIT License
1.3k stars 66 forks source link

Remove the need for the `async_trait` crate by leveraging the native `async fn`s support now in Rust as of v1.75 #202

Closed slawlor closed 4 months ago

slawlor commented 4 months ago

https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html

This PR also makes the newly supported functionality opt-in via no-default-features and not enabling the async-trait feature (and therefore dependency).

Benchmarks show that functionality isn't generally impacted on small-scale tests, however by using async fn natively in the trait we risk a performance impact because this won't Box the futures into a BoxFuture and won't move the future onto the heap.