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§


fn stream_iter() -> T::Iterator

Create the streaming iterator.

Object Safety§

This trait is not object safe.



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