File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
# ` async ` in Traits
2
2
3
- Currently, ` async fn ` cannot be used in traits. The reasons for this are
4
- somewhat complex, but there are plans to remove this restriction in the
5
- future .
3
+ Currently, ` async fn ` cannot be used in traits on the stable release of Rust.
4
+ Since the 17th November 2022, an MVP of async-fn-in-trait is available on the nightly
5
+ version of the compiler tool chain, [ see here for details ] ( https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-nightly.html ) .
6
6
7
- In the meantime, however, this can be worked around using the
7
+ In the meantime, there is a work around for the stable tool chain using the
8
8
[ async-trait crate from crates.io] ( https://github.com/dtolnay/async-trait ) .
9
9
10
10
Note that using these trait methods will result in a heap allocation
You can’t perform that action at this time.
0 commit comments