Module once
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ยง
- Init
Once - A cell which may be initialized a single time after it is created.
- Lazy
- A cell which will be lazily initialized by the provided function the first time it is accessed.
- TryInit
Error - Errors returned by
InitOnce::try_init.