pub fn string_or_struct<'de, T, D>(deserializer: D) -> Result<T, D::Error>
Expand description
Deserialize a type T from either a string or struct by forwarding
string forms to FromStr
.
The use-case for this is to allow specifying key material in ownership configuration files either directly or by filename:
key: {
Ecdsa: "some/path/to/key.pub.der"
}
key: {
Ecdsa: {
x: "...",
y: "..."
}
}