Projects using atree might unintentionally mutate elements returned by readonly iterators.
As always, mutation of elements from readonly iterators are not guaranteed to persist.
This PR returns error from mutation functions, and supports callback functions that allow projects using atree to log or debug such mutations with extra context, panic, etc.
If elements from readonly iterators are mutated:
those changes are not guaranteed to persist.
mutation functions of child containers return ReadOnlyIteratorElementMutationError.
ReadOnlyMapIteratorMutationCallback are called (if provided and mutation occurs).
Two callback functions can be provided by using ReadOnlyIteratorWithMutationCallback.
Updates #409
Projects using atree might unintentionally mutate elements returned by readonly iterators.
As always, mutation of elements from readonly iterators are not guaranteed to persist.
This PR returns error from mutation functions, and supports callback functions that allow projects using atree to log or debug such mutations with extra context, panic, etc.
If elements from readonly iterators are mutated:
ReadOnlyIteratorElementMutationError
.ReadOnlyMapIteratorMutationCallback
are called (if provided and mutation occurs).Two callback functions can be provided by using
ReadOnlyIteratorWithMutationCallback
.main
branchFiles changed
in the Github PR explorer