Commit 97cbf6e2 authored by Wedson Almeida Filho's avatar Wedson Almeida Filho Committed by Treehugger Robot
Browse files

FROMLIST: rust: rbtree: add `RBTreeIterator`

- Add Iterator implementation (`RBTreeIterator`) for `RBTree`, allowing
  iteration over (key, value) pairs in key order.
- Add individual `keys()` and `values()` functions to iterate over keys
  or values alone.
- Update doctests to use iteration instead of explicitly getting items.

Iteration is needed by the binder driver to enumerate all values in a
tree for oneway spam detection [1].

Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-17-08ba9197f637@google.com/

 [1]
Signed-off-by: default avatarWedson Almeida Filho <wedsonaf@gmail.com>
Signed-off-by: default avatarMatt Gilbride <mattgilbride@google.com>

Bug: 324206405
Link: https://lore.kernel.org/all/20240205-b4-rbtree-v1-3-995e3eee38c0@google.com/


Change-Id: I29031d6d0d0a4b7d35e015bbca61473193605a12
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent adfa8383
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment