Cargo Features

[dependencies]
once_cell_serde = { version = "1.17.1", default-features = false, features = ["std", "alloc", "race", "parking_lot", "critical-section", "unstable", "atomic-polyfill", "serde"] }
default = std

The std feature is set by default whenever once_cell_serde is added without default-features = false somewhere in the dependency tree.

std default = alloc

Enables sync module.

Affects once_cell_serde::sync

alloc std = race

Enables race::OnceBox type.

race alloc?

Enables race module.

Affects once_cell_serde::race

parking_lot = parking_lot_core

Uses parking_lot to implement sync::OnceCell. This makes no speed difference, but makes each OnceCell<T> up to 16 bytes smaller, depending on the size of the T.

critical-section atomic-polyfill? = atomic_polyfill, critical_section

Uses critical-section to implement sync and race modules. in #![no_std] mode. Please read critical-section docs carefully before enabling this feature.

Affects once_cell_serde::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. These features may have been created by mistake, and this functionality may be removed in the future.

parking_lot_core parking_lot?

Enables parking_lot_core

These optional dependencies are considered private impl details, only features from [features] table are a part of semver-guarded API.

atomic_polyfill critical-section?

Enables atomic-polyfill

critical_section critical-section?

Enables critical-section

serde implicit feature

Enables serde

serde:

A generic serialization/deserialization framework