u64_of

Function u64_of 

Source
pub fn u64_of(v: &Value, keys: &[&str]) -> Option<u64>
Expand description

What: Extract an unsigned 64-bit integer by trying multiple keys and representations.

Inputs:

  • v: JSON value to extract from.
  • keys: Array of candidate keys to try in order.

Output:

  • Returns Some(u64) if a valid value is found, or None if no usable value is found.

Details:

  • Accepts any of the following representations for the first matching key:
    • JSON u64
    • JSON i64 convertible to u64 (must be positive)
    • String that parses as u64
  • Tries keys in the order provided and returns the first match.