#serde-serialize #serialization #no-std #sval #integration

no-std sval_serde

Integration between serde::Serialize and sval::Value

28 stable releases

new 2.14.1 Mar 24, 2025
2.13.2 Oct 15, 2024
2.13.0 Mar 28, 2024
2.10.2 Oct 19, 2023
2.0.2 Mar 24, 2023

#1654 in Encoding

Download history 123824/week @ 2024-12-02 230122/week @ 2024-12-09 175566/week @ 2024-12-16 48612/week @ 2024-12-23 100518/week @ 2024-12-30 268631/week @ 2025-01-06 243376/week @ 2025-01-13 195835/week @ 2025-01-20 211813/week @ 2025-01-27 222304/week @ 2025-02-03 209943/week @ 2025-02-10 205960/week @ 2025-02-17 242550/week @ 2025-02-24 239844/week @ 2025-03-03 246640/week @ 2025-03-10 219218/week @ 2025-03-17

953,771 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

~210–435KB
~10K SLoC