liver-shot
A lightweight, no_std JSON value position extractor.
Returns a Span (start/end byte offsets) rather than a parsed value,
so the caller decides how to use the original string.
Limitations
- Object navigation only - arrays at the top level or as a path step return
Error::is_unsupported_array. - Values are not validated — only their position is extracted.
Examples
Extract an object
let json = r#"{"a": {"b": "value", "c": [1, 2, 3]}}"#;
let span = find?;
assert_eq!;
Extract a nested object
let json = r#"{"a": {"b": {"c": "value"}}}"#;
let span = find?;
assert_eq!;
Extract an array
let json = r#"{"a": {"b": "value", "c": [1, 2, 3]}}"#;
let span = find?;
assert_eq!;
Reuse Span
let json = r#"{"a": {"b": "value", "c": [1, 2, 3]}}"#;
let a = find?;
let b = a.find?;
let c = a.find?;
assert_eq!;
assert_eq!;
assert_eq!;
License
Licensed under either of:
- Apache License, Version 2.0
- MIT license