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

no-std sval_serde

Integration between serde::Serialize and sval::Value

24 stable releases

2.13.0 Mar 28, 2024
2.11.1 Jan 31, 2024
2.10.2 Oct 19, 2023
2.6.1 Jun 27, 2023
2.0.2 Mar 24, 2023

#1683 in Encoding

Download history 85533/week @ 2024-03-14 91368/week @ 2024-03-21 103627/week @ 2024-03-28 106347/week @ 2024-04-04 112036/week @ 2024-04-11 108025/week @ 2024-04-18 102411/week @ 2024-04-25 107601/week @ 2024-05-02 111401/week @ 2024-05-09 114439/week @ 2024-05-16 127611/week @ 2024-05-23 133931/week @ 2024-05-30 128061/week @ 2024-06-06 125283/week @ 2024-06-13 116269/week @ 2024-06-20 110896/week @ 2024-06-27

510,750 downloads per month
Used in 3 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

~220–460KB
~11K SLoC