mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 05:45:19 +01:00
book: resources shared with init must also be Send
This commit is contained in:
parent
c4bad51deb
commit
e865cbb2e5
3 changed files with 47 additions and 0 deletions
|
|
@ -44,6 +44,14 @@ send operation where the initial value is sent from `idle`, which has the lowest
|
|||
priority of `0`, to a task with will run with a priority greater than or equal
|
||||
to `1`. Thus all late resources need to implement the `Send` trait.
|
||||
|
||||
Sharing a resource with `init` can be used to implement late initialization, see
|
||||
example below. For that reason, resources shared with `init` must also implement
|
||||
the `Send` trait.
|
||||
|
||||
``` rust
|
||||
{{#include ../../../../examples/shared-with-init.rs}}
|
||||
```
|
||||
|
||||
## `Sync`
|
||||
|
||||
Similarly, [`Sync`] is a marker trait for "types for which it is safe to share
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue