pub fn deserialize_cell_option_number_from_string<'de, T, D>(
deserializer: D,
) -> Result<Cell<Option<T>>, D::Error>
Expand description
Deserializes a Cell
option number from string or a number. Same logic as "deserialize_option_number_from_string"
.
ยงExample:
use serde_aux::prelude::*;
use std::cell::Cell;
#[derive(Debug, serde::Deserialize)]
struct MyStruct {
#[serde(deserialize_with = "deserialize_cell_option_number_from_string")]
v: Cell<Option<f32>>
}
let a = serde_qs::from_str::<MyStruct>("v=-0.1").unwrap();
assert_eq!(a.v, Cell::new(Some(-0.1)));