Crate sval_serde

Crate sval_serde 

Source
Expand description

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.

Structs§

ToSerialize
Adapt an sval::Value into a serde_core::Serialize.
ToValue
Adapt a serde_core::Serialize into a sval::Value.

Functions§

serialize
Serialize an sval::Value into a serde_core::Serializer.
stream
Stream a serde_core::Serialize into an sval::Stream.