Re: [PATCH] Rust: Implement a unique reference type URef supplementing ARef

Andreas Hindborg
2025-02-28T12:17:05Z

"Oliver Mangold" <oliver.mangold@pm.me> writes:

> On 250228 1210, Andreas Hindborg wrote:
>
> Hi Andreas,
>
>> Wrap at 75 characters please :)
>
>> See `AlwaysRefCounted` for reference on formatting.
>
>> Please use back ticks for types: [`ARef`], [`URref`]
>
>> For your next version, can you run `make rustfmt`?:
>
> Sorry for all that. Apparently I need to get used a bit more to how things
> are supposed to be done here. Please be patient with me for a bit :)
>
>> When the trait is unsafe, we need to specify the conditions under which
>> it is safe to implement:
>
> Of course. Sorry, missed that.
>
>> I would prefer `UniqueRef`. I know `ARef` has a different naming scheme,
>> but I think `UniqueRef` is sufficiently short and significantly more
>> descriptive than `URef`.
>
> Ok, will do. Honestly I also prefer UniqueRef.
>
>> Also it would be great if you include your "rust: for fix dec_ref for
>> URef<Request>" folded in.
>
> Are your sure? Wouldn't the patches have to be ordered like this?
>
> this patch (mine)
> rust: block: change `queue_rq` request type to unique (yours)
> rust: block: simplify reference counting scheme (yours)
> rust: for fix dec_ref for URef<Request> (mine)
>
> IOW, the latter requests depends on the 2 patches of yours, while these depend on this patch. You know what I mean?

Sorry, yes I meant "rust: allow to override dec_ref() for URef's".
Either include it in the series or fold it in, whatever makes most
sense.

The request update can go later.

Best regards,
Andreas Hindborg