chanced / jsonptr

JSON Pointer (RFC 6901) implementation for Rust
Apache License 2.0
44 stars 4 forks source link

Allow for splitting a `Pointer` by `Token` position (index) #42

Open chanced opened 2 months ago

chanced commented 2 months ago

Per our discussion, we need a way to index a token. With the index, at minimum, we need to be able to split a pointer at it, retrieve the token, and expose it via an iterator.

Once created, AssignError, ResolveError, and DeleteError need to be updated to include it, replacing offset.

/foo/bar/baz
↑   ↑   ↑
0   1   2
chanced commented 2 months ago

Alternatively, we just continue to use the offsets.