Skip to main content

Module de

Module de 

Source
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

StructpropRust / serde
scalar "true" / "false"bool
scalar integer string (e.g. 42, -7)i8i64, u8u64
scalar float string (e.g. 3.14)f32, f64
single-character scalarchar
scalar "null"Option<T> (None) / () / unit struct
any other scalarString / &str
scalar (inner type)newtype struct — transparent wrapper
key = { … }Vec<T> / tuple / tuple struct
key { … }struct / map
bare variant nameunit enum variant
variant_name = <scalar or list>newtype / tuple enum variant
variant_name { … }struct enum variant

Functions§

from_str
Deserialize an instance of T from a structprop-formatted string.
from_value
Deserialize an instance of T from an already-parsed Value tree.