pub trait StorageAppender<V: FullCodec> {
    // Required method
    fn append<EncodeLikeValue>(&mut self, item: EncodeLikeValue)
       where EncodeLikeValue: EncodeLike<V>;

    // Provided method
    fn append_many<EncodeLikeValue, I>(&mut self, items: I)
       where EncodeLikeValue: EncodeLike<V>,
             I: IntoIterator<Item = EncodeLikeValue> { ... }
}
Expand description

Append iterator to append values to a storage struct.

Can be used in situations where appending does not have constant time complexity.

Required Methods§

source

fn append<EncodeLikeValue>(&mut self, item: EncodeLikeValue)where EncodeLikeValue: EncodeLike<V>,

Append a single item in constant time O(1).

Provided Methods§

source

fn append_many<EncodeLikeValue, I>(&mut self, items: I)where EncodeLikeValue: EncodeLike<V>, I: IntoIterator<Item = EncodeLikeValue>,

Append many items in linear time O(items.count()).

Implementors§