#serialization #no-std #sval

no-std sval_serde

Integration between serde::Serialize and sval::Value

28 stable releases

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

#2690 in Encoding

Download history 220292/week @ 2025-01-31 208930/week @ 2025-02-07 200030/week @ 2025-02-14 247222/week @ 2025-02-21 241993/week @ 2025-02-28 242331/week @ 2025-03-07 229558/week @ 2025-03-14 244298/week @ 2025-03-21 247187/week @ 2025-03-28 254447/week @ 2025-04-04 228860/week @ 2025-04-11 204926/week @ 2025-04-18 188794/week @ 2025-04-25 194641/week @ 2025-05-02 232603/week @ 2025-05-09 194732/week @ 2025-05-16

853,548 downloads per month
Used in 4 crates (via value-bag-sval2)

Apache-2.0 OR MIT

290KB
7.5K SLoC

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.


sval_serde

Rust Latest version Documentation Latest

Integration between sval and serde.

Dependencies

~210–425KB