decode_optional_i32

Function decode_optional_i32 

Source
fn decode_optional_i32(payload: &Value, field: &str) -> Option<Option<i32>>
Expand description

Decode an optional i32 JSON field.

Returns:

  • Some(None) when the field is absent
  • Some(Some(value)) when present and valid
  • None when present but malformed or out of range for i32