diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-02-02 09:25:16 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-06 02:22:58 +0000 |
| commit | 827bfe4154a9679a173755bb2098b863ef890f70 (patch) | |
| tree | c48dc05e8597e0c7190214ca01e3d22471619f76 /src | |
| parent | ca444160232a1bf1914da906da9e061a7636955c (diff) | |
Document `async_fn_traits`
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/unstable-book/src/library-features/async-fn-traits.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/library-features/async-fn-traits.md b/src/doc/unstable-book/src/library-features/async-fn-traits.md new file mode 100644 index 00000000000..e1c3f067e5b --- /dev/null +++ b/src/doc/unstable-book/src/library-features/async-fn-traits.md @@ -0,0 +1,13 @@ +# `async_fn_traits` + +See Also: [`fn_traits`](../library-features/fn-traits.md) + +---- + +The `async_fn_traits` feature allows for implementation of the [`AsyncFn*`] traits +for creating custom closure-like types that return futures. + +[`AsyncFn*`]: ../../std/ops/trait.AsyncFn.html + +The main difference to the `Fn*` family of traits is that `AsyncFn` can return a future +that borrows from itself (`FnOnce::Output` has no lifetime parameters, while `AsyncFn::CallFuture` does). |
