On 11/23/2025 10:47 PM, Alexandre Courbot wrote:
>> +}
>> +
>> +/// Low-level iterator over `list_head` nodes.
>> +///
>> +/// An iterator used to iterate over a C intrusive linked list
>> (`list_head`). Caller has to
>> +/// perform conversion of returned `ClistHead` to an item (typically using
>> `container_of` macro).
>> +///
>> +/// # Invariants
>> +///
>> +/// `ClistHeadIter` is iterating over an allocated, initialized and valid
>> `Clist`.
>> +pub struct ClistHeadIter<'a> {
>> + current: &'a ClistHead,
>> + head: &'a ClistHead,
>
> IIUC `head` should probably be a `Clist`?
Sure, but then I would rename it from 'head' to 'list' then, if that's Ok.
The iterator holds the list, and the current position, which makes sense to me.
thanks,
- Joel
- Joel
- [PATCH v2 1/3] rust: helpers: Add list helpers for C lin... Joel Fernandes
- [PATCH v2 2/3] rust: clist: Add basic list infrastr... Joel Fernandes
- Re: [PATCH v2 2/3] rust: clist: Add basic list ... Alexandre Courbot
- Re: [PATCH v2 2/3] rust: clist: Add basic l... Joel Fernandes
- Re: [PATCH v2 2/3] rust: clist: Add basic l... Joel Fernandes
- Re: [PATCH v2 2/3] rust: clist: Add basic list ... Daniel Almeida
- [PATCH v2 3/3] rust: clist: Add typed iteration wit... Joel Fernandes
- Re: [PATCH v2 3/3] rust: clist: Add typed itera... Alexandre Courbot
- Re: [PATCH v2 3/3] rust: clist: Add typed i... Joel Fernandes
- Re: [PATCH v2 3/3] rust: clist: Add typ... Alexandre Courbot
- Re: [PATCH v2 3/3] rust: clist: Ad... Joel Fernandes
- Re: [PATCH v2 3/3] rust: clist... Alexandre Courbot
- Re: [PATCH v2 3/3] rust: c... Joel Fernandes
- [PATCH v2 0/3] rust: Introduce support for C linked... Joel Fernandes
- Re: [PATCH v2 0/3] rust: Introduce support for ... Miguel Ojeda
