lib.rs
SHA-25692c3974a0a1c92e75cca75a287ad9241b436b807929854385435d1f4b80931f3
Malecule∅
Evidence
1/*!
2A macro for declaring lazily evaluated statics.
3
4Using this macro, it is possible to have `static`s that require code to be
5executed at runtime in order to be initialized.
6This includes anything requi …
22:10… c
23
24For a given `static ref NAME: TYPE = EXPR;`, the macro generates a unique type that
25implements `Deref<TYPE>` and stores it in a static with name `NAME`. (Metadata ends up
26attaching to this type.)
27
28On first deref, `EXPR` gets evaluated …
60:5… println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap());
61 println!("A expensive calculation on a static results in: {}.", *NUMBER);
62}
63` …
82:53… ]
83#[path="core_lazy.rs"]
84pub mod lazy;
85
86pub use core::ops::Deref as __Deref;
87
88#[macro_export]
89#[cfg_attr(feature="nightly", allow_internal_unstable)]
90macro_rule …