Module serde_string_or_struct

Source
Expand description

Tools for working with fields that might contain a string, or might contain a struct. This code is based on: https://github.com/emk/compose_yml/blob/7e8e0f47dcc41cf08e15fe082ef4c40b5f0475eb/src/v2/string_or_struct.rs

Structs§

SeqAccessError

Traits§

SerializeStringOrStruct
Some structs can be serialized as a string, but only under certain circumstances.

Functions§

deserialize_opt_box_string_or_struct
deserialize_opt_string_or_struct
Like string_or_struct, but it also handles the case where the value is optional.
deserialize_string_or_struct
Handle a value which may either a struct that deserializes as type T, or a bare string that can be turned into a type T using FromStr::from_str. We do this in a clever way that allows us to be generic over multiple such types, and which allows us to use the structure deserialization code automatically generated by serde.
deserialize_vec_box_string_or_struct
serialize_opt_box_string_or_struct
Like serialize_string_or_struct, but can also handle missing values.
serialize_opt_string_or_struct
Like serialize_string_or_struct, but can also handle missing values.
serialize_string_or_struct
Serialize the specified value as a string if we can, and a struct otherwise.
serialize_vec_box_string_or_struct
Like serialize_string_or_struct, but can also handle missing values.