#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

#1483 in Encoding

Download history 163440/week @ 2024-08-17 167170/week @ 2024-08-24 180951/week @ 2024-08-31 216481/week @ 2024-09-07 192285/week @ 2024-09-14 218657/week @ 2024-09-21 217177/week @ 2024-09-28 251562/week @ 2024-10-05 221307/week @ 2024-10-12 224319/week @ 2024-10-19 218813/week @ 2024-10-26 224148/week @ 2024-11-02 218163/week @ 2024-11-09 192854/week @ 2024-11-16 139412/week @ 2024-11-23 120501/week @ 2024-11-30

710,828 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

~215–440KB
~10K SLoC