|new 0.1.5||Dec 9, 2023|
|0.1.4||Dec 5, 2023|
|0.1.3||Nov 23, 2023|
|0.1.1||Aug 16, 2023|
#458 in Algorithms
130 downloads per month
Gat Lending Iterator
My concept for what a lending iterator crate should look like. Work in progress.
Iterator methods can work as is on
LendingIterators, but some wouldn't make sense. Basically any method that needs to look at more than one element at once isn't possible.
LendingIterator methods may return something that can act as an
Iterator. For example
map, when the function passed to it returns a value that isn't tied to the lifetime of its input. In these cases, my design choice was to conditionally implement IntoIterator for the adapter.
I've also included an extension trait
ToLendingIterator: IntoIterator for iterators that allows turning them into lending iterators in various ways, for example over windows of elements. It's possible I will add more methods to this trait.
methods that behave the same on
LendingIterators as they do on
methods that don't make sense on
methods that behave differently on
methods that can sometimes be used to convert a
LendingIterator into an
methods I'm not sure about