-
Notifications
You must be signed in to change notification settings - Fork 17
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
Async traits implementation from nightly #17
Comments
This is indeed posiible. However the async fn in trait RFC is still in early development and not stablized yet, so I think it more appropriate to add a feature gate to do so. |
Stabilization update: https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html |
Working on this. |
I released #[maybe_async::maybe_async(AFIT)]
trait A {
async fn async_fn_in_trait() -> Result<(), ()>;
}
struct Foo;
#[maybe_async::maybe_async(AFIT)]
impl A for Foo {
async fn async_fn_in_trait() -> Result<(), ()> {
Ok(())
}
} It will become the default in the future major release, but not for now. |
Close as solved in |
This crate currently uses the
async_trait
crate to support async functions in traits.My understanding of async is not very deep but I wonder if it would be possible to use the implementation that is available on nightly instead? (see https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-nightly.html)
The text was updated successfully, but these errors were encountered: