Crate oncelock

Crate oncelock 

Source
Expand description

Implements the lazy initialization primitives OnceLock and OnceCell.

These mirror the standard library types std::sync::OnceLock and std::cell::OnceCell, but work on much older versions of the rust compiler.

Optionally uses parking_lot or spin for synchronization.

Consider using the once_cell crate if you are not worried about supporting old rust versions. It offers many more features.

Re-exports§

pub use self::cell::LazyCell;
pub use self::cell::OnceCell;
pub use self::sync::LazyLock;
pub use self::sync::OnceLock;

Modules§

cell
Implements the OnceCell and LazyCell types.
sync
Implements the OnceLock and LazyLock types.