alloy_serde

Function null_as_default

source
pub fn null_as_default<'de, T, D>(deserializer: D) -> Result<T, D::Error>
where T: Deserialize<'de> + Default, D: Deserializer<'de>,
Expand description

For use with serde’s deserialize_with on a sequence that must be deserialized as a single but optional (i.e. possibly null) value.