linux/rust/kernel/sync
Alexandre Courbot 2009a2d569 rust: sync: implement Borrow and BorrowMut for Arc types
Implement `Borrow<T>` and `BorrowMut<T>` for `UniqueArc<T>`, and
`Borrow<T>` for `Arc<T>`. This allows these containers to be used in
generic APIs asking for types implementing those traits. `T` and `&mut
T` also implement those traits allowing users to use either owned,
shared or borrowed values.

`ForeignOwnable` makes a call to its own `borrow` method which must be
disambiguated.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://lore.kernel.org/r/20250616-borrow_impls-v4-2-36f9beb3fe6a@nvidia.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-07-03 20:46:29 +02:00
..
arc rust: provide proper code documentation titles 2024-10-07 21:39:57 +02:00
lock Rust changes for v6.15 2025-03-30 17:03:26 -07:00
arc.rs rust: sync: implement Borrow and BorrowMut for Arc types 2025-07-03 20:46:29 +02:00
completion.rs rust: completion: implement initial abstraction 2025-06-13 23:46:56 +02:00
condvar.rs Rust changes for v6.15 2025-03-30 17:03:26 -07:00
lock.rs Rust changes for v6.15 2025-03-30 17:03:26 -07:00
locked_by.rs rust: sync: add missing newline in locked_by log example 2025-03-06 20:44:06 +01:00
poll.rs rust: enable clippy::ptr_as_ptr lint 2025-06-22 23:08:42 +02:00
rcu.rs rust: sync: rcu: Mark Guard methods as inline 2025-05-16 09:00:54 -04:00