Function deserialize_opt_hex_u64

Source
pub fn deserialize_opt_hex_u64<'de, D>(
    deserializer: D,
) -> Result<Option<u64>, D::Error>
where D: Deserializer<'de>,
Expand description

Custom deserializer that converts an optional hexadecimal string into an Option<u64>.

The field is treated as optional – if the JSON field is null or absent the function returns Ok(None). When the value is present it is parsed via from_str_hex_to_u64 and wrapped in Some(..).

§Errors

Returns a serde::de::Error if the provided string is not valid hexadecimal or if the value is larger than the u64 range.