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

no-std sval_serde

Integration between serde::Serialize and sval::Value

27 stable releases

new 2.14.0 Jan 14, 2025
2.13.2 Oct 15, 2024
2.13.1 Sep 14, 2024
2.13.0 Mar 28, 2024
2.0.2 Mar 24, 2023

#1519 in Encoding

Download history 213808/week @ 2024-09-25 232839/week @ 2024-10-02 237596/week @ 2024-10-09 223799/week @ 2024-10-16 228931/week @ 2024-10-23 210095/week @ 2024-10-30 224639/week @ 2024-11-06 208907/week @ 2024-11-13 193688/week @ 2024-11-20 105446/week @ 2024-11-27 168664/week @ 2024-12-04 212699/week @ 2024-12-11 125592/week @ 2024-12-18 50303/week @ 2024-12-25 150279/week @ 2025-01-01 239422/week @ 2025-01-08

601,225 downloads per month
Used in 4 crates (via value-bag-sval2)

Apache-2.0 OR MIT

290KB
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

~215–440KB
~10K SLoC