#serialization #sval #no-std #value #integration

no-std sval_serde

Integration between serde::Serialize and sval::Value

26 stable releases

2.13.2 Oct 15, 2024
2.13.0 Mar 28, 2024
2.10.2 Oct 19, 2023
2.6.1 Jun 27, 2023
2.0.2 Mar 24, 2023

#1477 in Encoding

Download history 213541/week @ 2024-09-19 208742/week @ 2024-09-26 248202/week @ 2024-10-03 227173/week @ 2024-10-10 216238/week @ 2024-10-17 237422/week @ 2024-10-24 202725/week @ 2024-10-31 224489/week @ 2024-11-07 203235/week @ 2024-11-14 180419/week @ 2024-11-21 110393/week @ 2024-11-28 187265/week @ 2024-12-05 205831/week @ 2024-12-12 89043/week @ 2024-12-19 51213/week @ 2024-12-26 147659/week @ 2025-01-02

540,031 downloads per month
Used in 4 crates (via value-bag-sval2)

Apache-2.0 OR MIT

285KB
7.5K SLoC

sval_serde

Rust Latest version Documentation Latest

Integration between sval and serde.


lib.rs:

Treat any sval::Value as a serde::Serialize.

This crate provides ToSerialize, a wrapper around any sval::Value that forwards it through serde.

Buffering

Add the alloc feature to enable buffering for values that need it.

Types that derive sval::Value automatically can be streamed through serde without requiring any buffering. Types that manually stream text across multiple fragments, or nested fields without recursing through Stream::value will need to be buffered.

Without the alloc feature, any values that require buffering will instead produce errors during serialization.

Dependencies

~210–435KB
~10K SLoC