referrerpolicy=no-referrer-when-downgrade

Trait frame_support::storage::StorageAppender

source ·
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()).

Object Safety§

This trait is not object safe.

Implementors§