Module path
Available on crate feature
std only.Expand description
JSONPath parsing and typed construction.
Rama targets RFC 9535 JSONPath. This module implements the selectors that can be matched efficiently from the concrete path of a value observed by a forward streaming parser.
§RFC 9535 support matrix
| Feature | Status | Notes |
|---|---|---|
Root selector $ | supported | Always the implicit path root. |
Dot member .name | supported | RFC identifier shorthand. |
Bracket member ['name'] / ["name"] | supported | JSON string escapes, including surrogate pairs. |
Wildcard * | supported | Child and descendant forms. |
Array index [0] | supported | Non-negative indexes. |
Array slice [start:end:step] | supported | Non-negative bounds and non-negative step. A zero step matches no elements. |
Selector lists / unions [0,'name',*] | supported | Child and descendant forms. |
Descendant segment .. | supported | Member, index, wildcard, slice, and union selectors. |
| Negative indexes / slices | unsupported | RFC semantics require array length, which a pure forward matcher does not know. |
Filter selectors [?(...)] | unsupported | Requires an expression evaluator and possibly buffered subtrees. |
§Example
use rama_json::path::JsonPath;
let path = JsonPath::builder()
.member("store")
.member("book")
.wildcard()
.member("author")
.build();
assert_eq!(path.to_string(), "$.store.book[*].author");Structs§
- Json
Path - A compiled JSONPath expression.
- Json
Path Builder - Typed builder for
JsonPath. - Slice
- RFC 9535 array slice selector with streaming-compatible semantics.
Enums§
- Path
Element - One concrete location segment for a value encountered in a JSON document.
- Segment
- One JSONPath selector segment after the root.