summaryrefslogtreecommitdiff
path: root/rust/kernel/pci.rs
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2025-06-16 12:34:06 +0900
committerMiguel Ojeda <ojeda@kernel.org>2025-07-03 20:46:29 +0200
commit2009a2d5696944d85c34d75e691a6f3884e787c0 (patch)
tree8892a6da03907f76be9795c8281e6b3c6c06c2a2 /rust/kernel/pci.rs
parentd6763e0abb43d550791eb66d2b91e82cb29807f9 (diff)
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>
Diffstat (limited to 'rust/kernel/pci.rs')
0 files changed, 0 insertions, 0 deletions