6 releases (breaking)

Uses old Rust 2015

0.5.0 Jan 18, 2021
0.4.0 Aug 22, 2020
0.3.0 Jan 18, 2018
0.2.0 Nov 11, 2017
0.1.1 Jan 28, 2017

#201 in Science

Download history 174/week @ 2021-06-23 157/week @ 2021-06-30 174/week @ 2021-07-07 209/week @ 2021-07-14 232/week @ 2021-07-21 500/week @ 2021-07-28 301/week @ 2021-08-04 236/week @ 2021-08-11 395/week @ 2021-08-18 381/week @ 2021-08-25 261/week @ 2021-09-01 279/week @ 2021-09-08 213/week @ 2021-09-15 265/week @ 2021-09-22 221/week @ 2021-09-29 271/week @ 2021-10-06

2,015 downloads per month
Used in 13 crates (5 directly)

Apache-2.0/MIT

14KB
227 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