#serialization #no-std

no-std sval_serde

Integration between serde::Serialize and sval::Value

17 stable releases

new 2.9.2 Sep 30, 2023
2.9.1 Sep 29, 2023
2.6.1 Jun 27, 2023
2.5.0 May 29, 2023
2.0.2 Mar 24, 2023

#886 in Encoding

Download history 24070/week @ 2023-06-10 20070/week @ 2023-06-17 22198/week @ 2023-06-24 22502/week @ 2023-07-01 24277/week @ 2023-07-08 27025/week @ 2023-07-15 29322/week @ 2023-07-22 31454/week @ 2023-07-29 30264/week @ 2023-08-05 31624/week @ 2023-08-12 35404/week @ 2023-08-19 55996/week @ 2023-08-26 51748/week @ 2023-09-02 50857/week @ 2023-09-09 45605/week @ 2023-09-16 52570/week @ 2023-09-23

209,468 downloads per month
Used in 2 crates (via value-bag-sval2)

Apache-2.0 OR MIT

295KB
8K 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

~175–445KB