pub trait StorageStreamIter<T: StreamIter> {
    // Required method
    fn stream_iter() -> T::Iterator;
}
Expand description

An iterator that streams values directly from storage.

Requires that T implements the sealed trait StreamIter.

Instead of loading the entire T into memory, the iterator only loads a certain number of bytes into memory to decode the next T::Item. The iterator implementation is allowed to have some internal buffer to reduce the number of storage reads. The iterator should have an almost constant memory usage over its lifetime. If at some point there is a decoding error, the iterator will return None to signal that the iterator is finished.

Required Methods§

source

fn stream_iter() -> T::Iterator

Create the streaming iterator.

Implementors§

source§

impl<T: StreamIter + FullCodec, StorageValue: StorageValue<T>> StorageStreamIter<T> for StorageValue