Crate iterator_cache

Source
Expand description

§Iterator Cache

‘Unlazies your evaluation’ by caching items from your iterator now to be used later.

Could be useful when an iterator is running an expensive operation and you’d rather it run now and store the values for later than perform the operation later.

Structs§

EnqueueWhileIteratorIsEmptyError
Error thrown when enqueue() is called but the iterator is empty
IteratorCache
Extract a certain amount of items from any iterator into a cache with the cache() method. When extracting from the resulting iterator, items will first be pulled from cache until it is exhausted .

Traits§

IterateIntoCache
Any Iterator can have its values cached with the methods in this trait. (Currently only iterators where Item: Clone are supported, due to trait bounds on the queue from the queues crate)