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 / serde | Structprop output |
|---|---|
bool | true or false scalar |
i8–i64, u8–u64 | bare integer scalar (e.g. 42, -7) |
f32, f64 | bare float scalar (e.g. 3.14) |
char | bare single-character scalar (quoted if the character is special) |
String / &str | bare scalar, or "quoted" if it contains spaces, tabs, newlines, carriage returns, #, {, }, or =, or is empty; yields Error::UnsupportedType if the value requires quoting and contains ", or if the value starts with " |
None / () / unit struct | null scalar |
| newtype struct | transparent — serializes as the inner value |
| struct / map | key { … } block at the current indentation level |
Vec<T> / sequence / tuple / tuple struct | = { … } inline list |
| unit enum variant | bare variant name scalar |
| newtype enum variant | variant_name = <scalar or list> |
| tuple enum variant | variant_name = { … } list |
| struct enum variant | variant_name { … } block |
Structs§
- MapSerializer
ser::SerializeMap(and struct impls) that writeskey = 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.