Cargo Features

[dependencies]
sp-runtime = { version = "39.0.2", default-features = false, features = ["std", "try-runtime", "runtime-benchmarks", "serde"] }
default = std

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

std default = rand, simple-mermaid

Enables std of parity-scale-codec, use_std of either and std of hash256-std-hasher, log, num-traits, scale-info, serde, sp-application-crypto, sp-arithmetic, sp-core, sp-io, sp-std, sp-weights, and tracing

serde:

Provide impls for common standard library types like Vec<T> and HashMap<K, V>.
Requires a dependency on the Rust standard library.

Affects sp-runtime::testing, sp-runtime::BuildStorage, sp-runtime::BuildModuleGenesisStorage, traits::BlockIdTo, traits::BlockNumberProvider.set_block_number

try-runtime

Affects traits::Checkable.unchecked_into_checked_i_know_what_i_am_doing

runtime-benchmarks

Affects traits::BlockNumberProvider.set_block_number

serde std

Serde support without relying on std features.

Enables serde, serde of scale-info, serde of sp-application-crypto, sp-arithmetic, sp-core, and sp-weights

Affects header::serialize_number, header::deserialize_number

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.

rand std
simple-mermaid std