Skip to main content

Once

Type Alias Once 

Source
pub type Once<T = ()> = Once<T>;
Expand description

A spin-based one-time initialization cell, identical on every target.

Prefer SyncOnceCell for plain lazy initialization; use this when the fallible spin::Once::try_call_once API is needed. A primitive that provides lazy one-time initialization. See once::Once for documentation.

A note for advanced users: this alias exists to avoid subtle type inference errors due to the default relax strategy type parameter. If you need a non-default relax strategy, use the fully-qualified path.

Aliased Typeยง

pub struct Once<T = ()> { /* private fields */ }