referrerpolicy=no-referrer-when-downgrade
frame_support::storage

Trait 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()).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§