5 releases (3 breaking)

Uses old Rust 2015

0.4.0 Aug 22, 2020
0.3.0 Jan 18, 2018
0.2.0 Nov 11, 2017
0.1.1 Jan 28, 2017
0.1.0 Jan 27, 2017

#123 in Concurrency

Download history 145/week @ 2020-08-11 193/week @ 2020-08-18 231/week @ 2020-08-25 194/week @ 2020-09-01 243/week @ 2020-09-08 188/week @ 2020-09-15 239/week @ 2020-09-22 210/week @ 2020-09-29 170/week @ 2020-10-06 203/week @ 2020-10-13 230/week @ 2020-10-20 907/week @ 2020-10-27 1027/week @ 2020-11-03 1503/week @ 2020-11-10 1255/week @ 2020-11-17 396/week @ 2020-11-24

656 downloads per month
Used in 6 crates (3 directly)

Apache-2.0/MIT

11KB
184 lines


lib.rs:

A crate for things that are

  1. Lazily initialized
  2. Expensive to create
  3. Immutable after creation
  4. Used on multiple threads

Lazy<T> is better than Mutex<Option<T>> because after creation accessing T does not require any locking, just a single boolean load with Ordering::Acquire (which on x86 is just a compiler barrier, not an actual memory barrier).

No runtime deps