]> www.infradead.org Git - users/hch/misc.git/commit
rust: list: add iterators
authorAlice Ryhl <aliceryhl@google.com>
Wed, 14 Aug 2024 08:05:26 +0000 (08:05 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 23 Aug 2024 04:26:57 +0000 (06:26 +0200)
commitdeeecc9c1b979f45ca7b97255763505e5430cce5
tree8e911a01a79d5ec2866e566b23156b8c81eeed61
parentdb841866ecc01ca01ab93282d7809b87568a18ff
rust: list: add iterators

Rust Binder has lists containing stuff such as all contexts or all
processes, and sometimes needs to iterate over them. This patch enables
Rust Binder to do that using a normal for loop.

The iterator returns the ArcBorrow type, so it is possible to grab a
refcount to values while iterating.

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240814-linked-list-v5-7-f5f5e8075da0@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/list.rs