2015-08-30 22:06:10 +00:00
|
|
|
# A succinct name for the pattern
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
A short, prose description of the pattern.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
2015-10-22 20:53:16 +00:00
|
|
|
```rust
|
|
|
|
// An example of the pattern in action, should be mostly code, commented
|
|
|
|
// liberally.
|
|
|
|
```
|
2015-08-30 22:06:10 +00:00
|
|
|
|
2021-01-02 11:58:40 +00:00
|
|
|
When writing examples, please try to make them compile. This allows us to test
|
|
|
|
them. If you fail to write an example that is both complete and readable,
|
|
|
|
please at least mark your example code with `ignore` as in here:
|
|
|
|
|
|
|
|
```rust,ignore
|
|
|
|
// A non-runnable example of the pattern in action, should be mostly code, commented
|
|
|
|
// liberally.
|
|
|
|
```
|
|
|
|
|
2015-08-30 22:06:10 +00:00
|
|
|
## Motivation
|
|
|
|
|
|
|
|
Why and where you should use the pattern
|
|
|
|
|
|
|
|
## Advantages
|
|
|
|
|
|
|
|
Good things about this pattern.
|
|
|
|
|
|
|
|
## Disadvantages
|
|
|
|
|
|
|
|
Bad things about this pattern. Possible contraindications.
|
|
|
|
|
|
|
|
## Discussion
|
|
|
|
|
|
|
|
A deeper discussion about this pattern. You might want to cover how this is done
|
|
|
|
in other languages, alternative approaches, why this is particularly nice in
|
|
|
|
Rust, etc.
|
|
|
|
|
|
|
|
## See also
|
|
|
|
|
|
|
|
Related patterns (link to the pattern file). Versions of this pattern in other
|
|
|
|
languages.
|