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

no-std sval_serde

Integration between serde::Serialize and sval::Value

23 stable releases

new 2.12.0 Mar 27, 2024
2.11.1 Jan 31, 2024
2.10.2 Oct 19, 2023
2.9.2 Sep 30, 2023
2.0.2 Mar 24, 2023

#1617 in Encoding

Download history 75818/week @ 2023-12-06 64936/week @ 2023-12-13 40779/week @ 2023-12-20 28327/week @ 2023-12-27 65690/week @ 2024-01-03 71414/week @ 2024-01-10 83406/week @ 2024-01-17 75666/week @ 2024-01-24 72869/week @ 2024-01-31 75210/week @ 2024-02-07 78489/week @ 2024-02-14 96392/week @ 2024-02-21 92689/week @ 2024-02-28 85067/week @ 2024-03-06 82676/week @ 2024-03-13 75459/week @ 2024-03-20

353,843 downloads per month
Used in 2 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