Module mycelium_util::sync::once
Expand description
Cells storing a value which must be initialized prior to use.
This module provides:
InitOnce
: a cell storing aMaybeUninit
value which must be manually initialized prior to use.Lazy
: anInitOnce
cell coupled with an initializer function. TheLazy
cell ensures the initializer is called to initialize the value the first time it is accessed.
Structs
- A cell which may be initialized a single time after it is created.
- A cell which will be lazily initialized by the provided function the first time it is accessed.
- Errors returned by
InitOnce::try_init
.