Cargo Features

sp-runtime = { version = "37.0.0", 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, and sp-weights


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


Affects traits::Checkable.unchecked_into_checked_i_know_what_i_am_doing


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