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 @@ -224,10 +224,10 @@ Future<Output = T>`.
224
224
### "Initialization" pattern
225
225
226
226
One pattern that sometimes occurs is that a future has an "initialization" step
227
- which could ideally happen before the future starts being polled. Because the
228
- async function does not begin evaluating until you poll it, and it captures the
229
- lifetimes of its arguments, this pattern cannot be expressed with a single
230
- ` async fn ` .
227
+ which should be performed during its construction. This is useful when dealing
228
+ with data conversion and temporary borrows. Because the async function does not
229
+ begin evaluating until you poll it, and it captures the lifetimes of its
230
+ arguments, this pattern cannot be expressed directly with an ` async fn ` .
231
231
232
232
One option is to write a function that returns ` impl Future ` using a closure
233
233
which is evaluated immediately:
You can’t perform that action at this time.
0 commit comments