Module std::sync::once

source ·
Expand description

A “once initialization” primitive

This primitive is meant to be used to run one-time initialization. An example use case would be for initializing an FFI library.

Structs

  • A synchronization primitive which can be used to run a one-time global initialization. Useful for one-time initialization for FFI or related functionality. This type can only be constructed with Once::new().
  • State yielded to Once::call_once_force()’s closure parameter. The state can be used to query the poison status of the Once.

Enums

Constants