Re: [RFC PATCH 1/3] rust: implement wrapper for acpi_object
From: Gladyshev Ilya
Date: Tue Dec 23 2025 - 10:12:18 EST
On 12/23/25 01:44, Danilo Krummrich wrote:
On Mon Dec 22, 2025 at 10:47 PM CET, Gladyshev Ilya wrote:
I couldn't really decide between implementing all types or only the one
needed... Probably, I should provide simple implementations for all the
others, I will fix that.
If they are not needed by any of the drivers you're aiming at, you should
probably just drop them.
Ack.
Wouldn't it be confusing to overload Deref on a non "pointer-like" type
just for an implicit cast?
What do you mean with overload Deref? What I mean is
impl Deref for AcpiBuffer {
type Target = [u8];
[...]
}
I meant the same, just used strange terminology, sorry. If I understand it correctly, Deref trait gives you "overloaded" dereference operator as well as implicit coercion in many cases, and I don't know if I want them.
Personally, I prefer the explicit style like:
```
let a: &AcpiInteger = /* ... */;
call_func(/* u64: */ a.val())
```
rather than:
```
let a: &AcpiInteger = /* ... */;
call_func(/* u64: */ *a)
```
The former feels clearer to me; the latter gives me "smart pointer" vibes and feels a bit confusing, because there are no smart pointers.
That said, I'm not a Rust expert at all -- so if you believe this change is better, I'll implement it your way.