We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2db1f14 commit 27135e1Copy full SHA for 27135e1
src/async/pitfalls/async-traits.md
@@ -48,10 +48,16 @@ async fn main() {
48
49
<details>
50
51
+* The difficulty with `async trait` is in that the resulting `Future` does not
52
+ have a size known at compile time, because the size of the `Future` depends
53
+ on the implementation.
54
+
55
* `async_trait` is easy to use, but note that it's using heap allocations to
- achieve this, which has performance implications.
56
+ achieve this, and solve the unknow size problem above. This heap allocation
57
+ has performance overhead.
58
-* Try creating a new sleeper struct that will sleep for a random amount of time and adding it to the Vec.
59
+* Try creating a new sleeper struct that will sleep for a random amount of time
60
+ and adding it to the Vec.
61
62
* Try making the `sleep` call take `&mut self`.
63
0 commit comments