rust-embedded / heapless

Heapless, `static` friendly data structures
Apache License 2.0
1.52k stars 181 forks source link

`HistoryBuffer`: add `HistoryBufferView`, similar to `VecView` #480

Closed sosthene-nitrokey closed 3 months ago

sosthene-nitrokey commented 3 months ago

The view uses iter::Chain<Slice::Iter, Slice::Iter> as the iterator. This is conceptually simpler, and would also allow exposing the other guarantees of the iterator (Reverse, TrustedLen, Fused) if we want to. This also means the iterator does not have the const N: usize in its type.

We could change HistoryBuffer::oldest_ordered to use the same iterator, but that would be a breaking change.

sosthene-nitrokey commented 3 months ago

replaced by #493