-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check mutation of elements from readonly map iterator
This commit returns ReadOnlyIteratorElementMutationError when elements of readonly map iterator are mutated. Also, a callback can be provided by the caller to log or debug such mutations with more context. As always, mutation of elements from readonly iterators are not guaranteed to persist. Instead of relying on other projects not to mutate readonly elements, this commit returns ReadOnlyIteratorElementMutationError when elements from readonly iterators are mutated. This commit also adds readonly iterator functions that receive mutation callbacks. Callbacks are useful for logging, etc. with more context when mutation occurs. Mutation handling is the same with or without callbacks. If needed, other projects using atree can choose to panic in the callback when mutation is detected. 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
- Loading branch information
Showing
4 changed files
with
1,111 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.