Re: [PATCH v7 05/10] rust: io: add IoLoc and IoWrite types

From: Alexandre Courbot

Date: Sun Mar 08 2026 - 07:49:33 EST


On Sun Mar 8, 2026 at 6:40 AM JST, Danilo Krummrich wrote:
> On Sat Mar 7, 2026 at 10:10 PM CET, Gary Guo wrote:
>>> But if we can agree on
>>>
>>> bar.put(Reg::foo());
>>>
>>> or even
>>>
>>> bar.write_val(Reg::foo());
>>
>> I'm okay with either.
>
> write_val() or something similar please; put() is not a good choice for
> something that does not release a reference count in the kernel.

Right, that could end up being confusing.

>
> (As for write_val(), I'm generally fine with the name, but I want to note that
> it also may be slightly confusing as it is the two-argument write() method which
> distinguishes between location and value, whereas this one combines the two.)

Would `write_to` be better?

We can also rename the two arguments variant `write_at`, and call the
single argument one `write`, but since the two arguments method will
likely be the most used with the current design it makes sense to me
that it inherits the default name as well.