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

Check mutation of elements from readonly map iterator #410

Commits on May 21, 2024

  1. 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
    fxamacker committed May 21, 2024
    Configuration menu
    Copy the full SHA
    0d63aaf View commit details
    Browse the repository at this point in the history