Cargo Features

[dependencies]
parity-scale-codec = { version = "3.6.12", default-features = false, features = ["std", "derive", "bit-vec", "fuzz", "max-encoded-len", "chain-error", "full", "bytes", "generic-array"] }
default = std

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

std default fuzz? = chain-error

Enables std of optional bitvec, byte-slice-cast, and serde

bitvec:

The standard library includes the allocator.

Affects codec::IoReader, parity-scale-codec::alloc

derive = parity-scale-codec-derive
bit-vec = bitvec
fuzz = arbitrary, std
max-encoded-len

Enables the new MaxEncodedLen trait. NOTE: This is still considered experimental and is exempt from the usual SemVer guarantees. We do not guarantee no code breakage when using this.

Enables max-encoded-len of optional parity-scale-codec-derive

chain-error std

Make error fully descriptive with chaining error message.
Should not be used in a constrained environment.

full

This does not do anthing anymore. Remove with the next major release.

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.

serde std
parity-scale-codec-derive derive?
bitvec bit-vec?
bytes implicit feature

Enables bytes

bytes:

Types and traits for working with bytes

Affects codec::Input.scale_internal_decode_bytes, codec::decode_from_bytes

generic-array implicit feature

Enables generic-array ^0.14.7

generic-array:

Generic types implementing functionality of arrays

arbitrary fuzz?