Struct serde_kicad_sexpr::Option
source · [−]pub struct Option<T>(_);
Expand description
Deserialize an Option
in a way that is supported by the s-expression format.
Example
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields, rename = "size")]
struct Size(f32, f32);
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields, rename = "thickness")]
struct Thickness(f32);
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields, rename = "font")]
struct Font {
size: Size,
// This attribute enables our custom deserialize logic.
#[serde(with = "serde_kicad_sexpr::Option")]
thickness: Option<Thickness>,
bold: bool
}
Description
For a more detailed description, see deserialize_option
.