Skip to main content

Module ser

Module ser 

Source
Expand description

Serde serializer for structprop documents. Serde Serializer for the structprop format.

The public entry point is to_string. Internally a Serializer walks the serde data model and writes structprop text directly into an output String.

§Type mapping

Rust / serdeStructprop output
booltrue or false scalar
integer / floatnumeric scalar
String / &strbare scalar or "quoted" if it contains special chars
None / ()null scalar
struct / mapkey { … } block at the current indentation level
Vec<T> / sequence= { … } inline list
unit enum variantbare variant name scalar
newtype / tuple / struct enum variantvariant_name { … } block

Structs§

MapSerializer
ser::SerializeMap (and struct impls) that writes key = value / key { … } entries one at a time.
SeqSerializer
ser::SerializeSeq (and related tuple impls) that collects rendered items then emits them as a { … } block.
Serializer
Core serializer that accumulates structprop text in output.

Functions§

to_string
Serialize value into a structprop-formatted String.