Cargo Features

[dependencies]
alt_serde_json = { version = "1.0.61", default-features = false, features = ["std", "alloc", "preserve_order", "float_roundtrip", "arbitrary_precision", "raw_value", "unbounded_depth"] }

FEATURES

default = std

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

std default

Enables std of alt_serde

alt_serde:

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

Affects de::from_reader, alt_serde_json::ser, read::IoRead

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 alt_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.

float_roundtrip

Use sufficient precision when parsing fixed precision floats from JSON to ensure that they maintain accuracy when round-tripped through JSON. This comes at an approximately 2x performance cost for parsing floats compared to the default best-effort precision.

Unlike arbitrary_precision, this feature makes f64 -> JSON -> f64 produce output identical to 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.

Affects number::NumberFromString

raw_value

Provide a RawValue type that can hold unprocessed JSON during deserialization.

Affects read::Read.begin_raw_buffering, read::Read.end_raw_buffering

unbounded_depth

Provide a method disable_recursion_limit to parse arbitrarily deep JSON structures without any consideration for overflowing the stack. When using this feature, you will want to provide some other way to protect against stack overflows, such as by wrapping your Deserializer in the dynamically growing stack adapter provided by the serde_stacker crate. Additionally you will need to be careful around other recursive operations on the parsed result which may overflow the stack after deserialization has completed, including, but not limited to, Display and Debug and Drop impls.

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?

Enables indexmap ^1.5