Re: [PATCH v3 04/12] rust: xarray: add `XArrayState`

From: Andreas Hindborg

Date: Wed Feb 11 2026 - 02:43:43 EST


Daniel Gomez <da.gomez@xxxxxxxxxx> writes:

> On 2026-02-09 15:38, Andreas Hindborg wrote:
>> Add `XArrayState` as internal state for XArray iteration and entry
>> operations. This struct wraps the C `xa_state` structure and holds a
>> reference to a `Guard` to ensure exclusive access to the XArray for the
>> lifetime of the state object.
>>
>> The `XAS_RESTART` constant is also exposed through the bindings helper
>> to properly initialize the `xa_node` field.
>>
>> The struct and its constructor are marked with `#[expect(dead_code)]` as
>> there are no users yet. We will remove this annotation in a later patch.
>
> It makes sense to me to merge patch 4 and 5 to avoid this.

It's always a balance. When I merge things I tend to get comments that I
should split things out to make them easier to digest and review.


Best regards,
Andreas Hindborg