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

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

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

slawlor
Copy link
Owner

@slawlor slawlor commented Feb 10, 2024

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.

@slawlor slawlor force-pushed the async_trait branch 2 times, most recently from 9152c1f to 14b2f0e Compare February 10, 2024 02:34
@slawlor slawlor force-pushed the async_trait branch 7 times, most recently from 3938a14 to 6ddf015 Compare February 18, 2024 15:28
…`async fn`s support now in Rust as of v-2.75

    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).
@slawlor slawlor marked this pull request as ready for review February 18, 2024 15:44
@slawlor slawlor merged commit 7fa9823 into main Feb 18, 2024
10 checks passed
@slawlor slawlor deleted the async_trait branch February 19, 2024 01:54
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