This PR implements the Function Extension point in the JSONPath spec. This is still a WIP.
Not only are function extensions enabled by this PR, but a means is provided for crate users to define and register their own functions.
This largely hinges on the type system defined in the JSONPath spec, which is still being finalized by the working group. That, compounded with the fact that I have taken some liberties to get a working solution is why I will keep this in WIP for the time being.
Updates
Extensible function definitions via the inventory crate
Functions used by serde_json_path are compiled into an inventory using the inventory crate. This allows users of the crate to also define their own functions. See the tests/functions.rs integration test file for an example of such.
The crate ships with a set of built-in functions that can be gated with the feature flag registry, in case the user wants to define their own, e.g., length and match functions.
TODO
Introduce tracing
tracing was added to help debug parser, and query execution. This is gated with a feature, trace.
This PR implements the Function Extension point in the JSONPath spec. This is still a WIP.
Not only are function extensions enabled by this PR, but a means is provided for crate users to define and register their own functions.
This largely hinges on the type system defined in the JSONPath spec, which is still being finalized by the working group. That, compounded with the fact that I have taken some liberties to get a working solution is why I will keep this in WIP for the time being.
Updates
Extensible function definitions via the
inventory
crateFunctions used by
serde_json_path
are compiled into an inventory using theinventory
crate. This allows users of the crate to also define their own functions. See thetests/functions.rs
integration test file for an example of such.The crate ships with a set of built-in functions that can be gated with the feature flag
registry
, in case the user wants to define their own, e.g.,length
andmatch
functions.TODO
Introduce
tracing
tracing
was added to help debug parser, and query execution. This is gated with a feature,trace
.