Extract a bool value from a regorus object. Returns `None` when the key is absent or not a boolean.
(val: ®orus::Value, key: &str)
| 308 | /// Extract a bool value from a regorus object. Returns `None` when the key |
| 309 | /// is absent or not a boolean. |
| 310 | fn get_object_bool(val: ®orus::Value, key: &str) -> Option<bool> { |
| 311 | let key_val = regorus::Value::String(key.into()); |
| 312 | match val { |
| 313 | regorus::Value::Object(map) => match map.get(&key_val) { |
| 314 | Some(regorus::Value::Bool(b)) => Some(*b), |
| 315 | _ => None, |
| 316 | }, |
| 317 | _ => None, |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | fn get_object_u64(val: ®orus::Value, key: &str) -> Option<u64> { |
| 322 | let key_val = regorus::Value::String(key.into()); |