pub fn deserialize_as_f64_or_string<'de, D>(
deserializer: D,
) -> Result<Result<f64, String>, D::Error>where
D: Deserializer<'de>,
Expand description
A helper function to deserialize cell values as f64
,
useful when cells may also contain invalid values (i.e. strings).
It applies the [as_f64
] method to the cell value, and returns
Ok(Ok(value_as_f64))
if successful or Ok(Err(value_to_string))
if unsuccessful,
therefore never failing. This function is intended to be used with Serde’s
deserialize_with
field attribute.