Re: [PATCH v8 3/6] rust: rbtree: add iterator
From: Benno Lossin
Date: Mon Aug 05 2024 - 15:09:27 EST
On 27.07.24 22:30, Matt Gilbride wrote:
> From: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
>
> - Add Iterator implementation 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@xxxxxxxxxx/ [1]
> Signed-off-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Tested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Matt Gilbride <mattgilbride@xxxxxxxxxx>
> ---
> rust/kernel/rbtree.rs | 130 +++++++++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 112 insertions(+), 18 deletions(-)
Reviewed-by: Benno Lossin <benno.lossin@xxxxxxxxx>
---
Cheers,
Benno