Module mycelium_util::sync::spin::once
source · Expand description
Cells storing a value which must be initialized prior to use.
This module provides:
InitOnce: a cell storing aMaybeUninitvalue which must be manually initialized prior to use.Lazy: anInitOncecell coupled with an initializer function. TheLazycell 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.