Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize to allow any "target" to be adapted for use with JsonPointer #4

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

bassmanitram
Copy link

@bassmanitram bassmanitram commented Dec 22, 2023

This PR basically does the following:

  • Abstracts the get methods to a trait
  • Implements that trait for serde_json Value, simd_json OwnedValue and simd_json BorrowedValue
  • Updates the code to 2021 semantics

It is a breaking change from the original - the biggest difference being that the behaviour of getting
a Value from a container Value is now implemented on the value type, not the pointer, by virtue of
the new trait. However, ALL aspects of managing the JSON pointer itself are retained exactly as before
(except the update to 2021 semantics.

This of course, begs the question of whether, in fact, the JsonPointer type and its associated
artifacts and code should be in one crate, the new trait in a second, and implementations of that
trait in separate crates. We could then simple update THIS crate to have "legacy" behaviour via
a feature, and separate all the new stuff into the aforementioned crates. To discuss, I guess.

IT IS NOT YET READY! The following (at least) are required:

  • Re-introduction of some stuff I removed while trying to figure out how it worked!
  • "repair" Cargo.toml to reflect this crate's name, version etc etc
  • Features
  • Tests
  • Better "trait" inclusion semantics
  • Answer the above metaphysical questions :)

In the meantime, the functionality is available in a "stopgap" crate

Martin Bartlett added 11 commits December 21, 2023 17:40
DUH! Once the get methods were abstracted to a trait,
serde_json could easily be supported! So this commit generalizes the mods and allows them to be a PR to the
original repo - although there is a lot to do before actually
merging.
* Reverse the Trait - it gets implemented on the target now, not on the pointer.
* Update the doc
* Update the tests to include simd
* Lift to version 0.3.0 (breaks 0.2.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant