Cargo Features
[dependencies]
once_cell = { version = "1.19.0", default-features = false, features = ["std", "alloc", "race", "parking_lot", "critical-section", "unstable", "atomic-polyfill"] }
- default = std
-
The
std
feature is set by default wheneveronce_cell
is added without
somewhere in the dependency tree.default-features = false - std default = alloc
-
Enables
once_cell::sync
module. - alloc std = race
-
Enables
once_cell::race::OnceBox
type. - race alloc?
-
Enables
once_cell::race
module. - parking_lot
-
Uses parking_lot to implement once_cell::sync::OnceCell.
This makes no speed difference, but makes each OnceCell<T>
up to 16 bytes smaller, depending on the size of the T.Enables parking_lot_core
- critical-section atomic-polyfill? = portable-atomic
-
Uses
critical-section
to implementsync
andrace
modules. in#![no_std]
mode. Please readcritical-section
docs carefully before enabling this feature.Affects
once_cell::sync
… - unstable
-
Enables semver-exempt APIs of this crate.
At the moment, this feature is unused. - atomic-polyfill = critical-section
-
Only for backwards compatibility.
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features.