Expand description
Serde deserializer for structprop documents.
Serde Deserializer for the structprop format.
The public entry point is from_str. Internally the input is first
parsed into a Value tree by parse(), then the tree is walked
by a ValueDeserializer which implements serde::Deserializer.
§Type mapping
| Structprop | Rust / serde |
|---|---|
scalar "true" / "false" | bool |
scalar integer string (e.g. 42, -7) | i8–i64, u8–u64 |
scalar float string (e.g. 3.14) | f32, f64 |
| single-character scalar | char |
scalar "null" | Option<T> (None) / () / unit struct |
| any other scalar | String / &str |
| scalar (inner type) | newtype struct — transparent wrapper |
key = { … } | Vec<T> / tuple / tuple struct |
key { … } | struct / map |
| bare variant name | unit enum variant |
variant_name = <scalar or list> | newtype / tuple enum variant |
variant_name { … } | struct enum variant |
Functions§
- from_
str - Deserialize an instance of
Tfrom a structprop-formatted string. - from_
value - Deserialize an instance of
Tfrom an already-parsedValuetree.