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.

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.