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§
sourcefn append<EncodeLikeValue>(&mut self, item: EncodeLikeValue)where
EncodeLikeValue: EncodeLike<V>,
fn append<EncodeLikeValue>(&mut self, item: EncodeLikeValue)where EncodeLikeValue: EncodeLike<V>,
Append a single item in constant time O(1)
.
Provided Methods§
sourcefn append_many<EncodeLikeValue, I>(&mut self, items: I)where
EncodeLikeValue: EncodeLike<V>,
I: IntoIterator<Item = EncodeLikeValue>,
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())
.