Cargo Features

[dependencies]
serde_json_bytes = { version = "0.2.2", default-features = false, features = ["std", "alloc", "preserve_order", "arbitrary_precision"] }

FEATURES

default = std

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

std default

Enables std of serde

serde:

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

alloc

Provide integration for heap-allocated collections without depending on the rest of the Rust standard library. NOTE: Disabling both std and alloc features is not supported yet. Available on Rust 1.36+.

Enables alloc of serde

preserve_order = indexmap

Make serde_json::Map use a representation which maintains insertion order.
This allows data to be read into a Value and written back to a JSON string while preserving the order of map keys in the input.

arbitrary_precision

Use an arbitrary precision number representation for serde_json::Number. This allows JSON numbers of arbitrary size/precision to be read into a Number and written back to a JSON string without loss of precision.

Unlike float_roundtrip, this feature makes JSON -> serde_json::Number -> JSON produce output identical to the input.

Enables arbitrary_precision of serde_json

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.

indexmap preserve_order?