diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-11 20:41:49 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-11 20:41:49 +0000 |
| commit | 672886a67a80136f5620115772ceec1a628d8ee6 (patch) | |
| tree | 98361d6d3dfced4b068771c31163b324573294b7 /book/src/by-example/singletons.md | |
| parent | 1d52964df7abf9fba09933470d5c3dcce96760c4 (diff) | |
| parent | 0007a35a274ab2d07eb937e41971ea5e2c1cb5ff (diff) | |
Merge #139
139: russian translation r=japaric a=japaric
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
Diffstat (limited to 'book/src/by-example/singletons.md')
| -rw-r--r-- | book/src/by-example/singletons.md | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/book/src/by-example/singletons.md b/book/src/by-example/singletons.md deleted file mode 100644 index d83cf1c..0000000 --- a/book/src/by-example/singletons.md +++ /dev/null @@ -1,26 +0,0 @@ -# Singletons - -The `app` attribute is aware of [`owned-singleton`] crate and its [`Singleton`] -attribute. When this attribute is applied to one of the resources the runtime -will perform the `unsafe` initialization of the singleton for you, ensuring that -only a single instance of the singleton is ever created. - -[`owned-singleton`]: ../../api/owned_singleton/index.html -[`Singleton`]: ../../api/owned_singleton_macros/attr.Singleton.html - -Note that when using the `Singleton` attribute you'll need to have the -`owned_singleton` in your dependencies. - -Below is an example that uses the `Singleton` attribute on a chunk of memory -and then uses the singleton instance as a fixed-size memory pool using one of -the [`alloc-singleton`] abstractions. - -[`alloc-singleton`]: https://crates.io/crates/alloc-singleton - -``` rust -{{#include ../../../examples/singleton.rs}} -``` - -``` console -$ cargo run --example singleton -{{#include ../../../ci/expected/singleton.run}}``` |
