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 a MaybeUninit value which must be manually initialized prior to use.
  • Lazy: an InitOnce cell coupled with an initializer function. The Lazy 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.