Skip to main content

get_nested_value

Function get_nested_value 

Source
pub fn get_nested_value<'b>(
    data: &'b OwnedDataValue,
    path: &str,
) -> Option<&'b OwnedDataValue>
Expand description

Get a reference to the value at path, walking the tree.

Path syntax:

  • "user.name" — object property
  • "items.0" — array index
  • "user.addresses.0.city" — mixed
  • "data.#20" — object key literally named "20" (strip one leading #)
  • "data.##" — object key literally named "#" (strip one leading #)

Returns None for missing keys, out-of-bounds indices, invalid index formats, or attempts to descend through a non-container.