diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-14 16:11:13 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-14 16:11:13 +0000 |
| commit | 9527c921923f6b8e19767b1bf52be758817d7035 (patch) | |
| tree | de8ea7d2f2a38a1fb0ea3043d2daf33b44e8dd34 /book | |
| parent | 2ebd81fee2dc4c793a7c684c5c9050d4a5313bde (diff) | |
| parent | f111c825ba3ab886a1a6bf63a0689c3d63b0f441 (diff) | |
Merge #415
415: Multilock support r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/by-example/resources.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index 301961d..3a3e0b7 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -64,6 +64,14 @@ $ cargo run --example lock {{#include ../../../../ci/expected/lock.run}} ``` +## Multi-lock + +As an extension to `lock`, and to reduce rightward drift, locks can be taken as tuples. The following examples shows this in use: + +``` rust +{{#include ../../../../examples/multilock.rs}} +``` + ## Late resources Late resources are resources that are not given an initial value at compile time using the `#[init]` attribute but instead are initialized at runtime using the `init::LateResources` values returned by the `init` function. |
