sval_json
A no-std JSON implementation for the sval serialization framework.
sval_json is mostly pilfered from dtolnay's excellent miniserde project.
Minimum rustc
This library requires Rust 1.31.0.
Cargo features
sval_json has the following optional features that can be enabled in your Cargo.toml:
std: assumestdis available and add support forstdtypes.
How to use it
Add sval_json to your crate dependencies:
[]
= "0.4.3"
To write JSON to a fmt::Write
let json = to_fmt?;
To write JSON to a String
Add the std feature to your Cargo.toml to enable writing to a String:
[]
= ["std"]
let json = to_string?;
To write JSON to a io::Write
Add the std feature to your Cargo.toml to enable writing to an io::Write:
[]
= ["std"]
let json = to_writer?;