deserialize_empty_string_or_parse

Function deserialize_empty_string_or_parse 

Source
pub fn deserialize_empty_string_or_parse<'de, T, D>(
    deserializer: D,
) -> Result<Option<T>, D::Error>
where D: Deserializer<'de>, T: FromStr, T::Err: Display,
Expand description

deserialize an optional value with a FromStr implementation where None is represented as an empty string

ยงErrors

returns an error if the value can not be interpreted as null or a String