[][src]Crate sval_json

JSON support for sval.

This library is no-std, so it can be run in environments that don't have access to an allocator.

Getting started

Add sval_json to your Cargo.toml:

[dependencies.sval_json]
version = "0.4.2"

Writing JSON to fmt::Write

let json = sval_json::to_fmt(MyWrite, 42)?;

Writing JSON to a String

Add the std feature to your Cargo.toml to enable writing to a String:

[dependencies.sval_json]
features = ["std"]
let json = sval_json::to_string(42)?;

Writing JSON to a io::Write

Add the std feature to your Cargo.toml to enable writing to an io::Write:

[dependencies.sval_json]
features = ["std"]
let json = sval_json::to_writer(MyWrite, 42)?;

Structs

End

An error attempting to end a JSON stream.

Formatter

A stream for writing structured data as json.

Writer

A stream for writing structured data as json.

Functions

to_fmt

Write a sval::Value to a formatter.

to_string

Write a sval::Value to a string.

to_writer

Write a sval::Value to a writer.