Trait frame_support::storage::StorageList
source · pub trait StorageList<V: FullCodec> {
type Iterator: Iterator<Item = V>;
type Appender: StorageAppender<V>;
// Required methods
fn iter() -> Self::Iterator;
fn drain() -> Self::Iterator;
fn appender() -> Self::Appender;
// Provided methods
fn append_one<EncodeLikeValue>(item: EncodeLikeValue)
where EncodeLikeValue: EncodeLike<V> { ... }
fn append_many<EncodeLikeValue, I>(items: I)
where EncodeLikeValue: EncodeLike<V>,
I: IntoIterator<Item = EncodeLikeValue> { ... }
}
Expand description
A non-continuous container type.
Required Associated Types§
sourcetype Appender: StorageAppender<V>
type Appender: StorageAppender<V>
Append iterator for fast append operations.
Required Methods§
Provided Methods§
sourcefn append_one<EncodeLikeValue>(item: EncodeLikeValue)where
EncodeLikeValue: EncodeLike<V>,
fn append_one<EncodeLikeValue>(item: EncodeLikeValue)where EncodeLikeValue: EncodeLike<V>,
Append a single element.
Should not be called repeatedly; use append_many
instead.
Worst case linear O(len)
with len
being the number if elements in the list.
sourcefn append_many<EncodeLikeValue, I>(items: I)where
EncodeLikeValue: EncodeLike<V>,
I: IntoIterator<Item = EncodeLikeValue>,
fn append_many<EncodeLikeValue, I>(items: I)where EncodeLikeValue: EncodeLike<V>, I: IntoIterator<Item = EncodeLikeValue>,
Append many elements.
Should not be called repeatedly; use appender
instead.
Worst case linear O(len + items.count())
with len
beings the number if elements in the
list.