pub trait IterableStorageDoubleMapExtended<K1: FullCodec, K2: FullCodec, V: FullCodec>: StorageDoubleMap<K1, K2, V> {
type PrefixIterator: Iterator<Item = (K2, V)>;
type Iterator: Iterator<Item = (K1, K2, V)>;
fn iter_prefix(
k1: impl EncodeLike<K1>,
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::PrefixIterator;
fn drain_prefix(
k1: impl EncodeLike<K1>,
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::PrefixIterator;
fn iter(
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::Iterator;
fn drain(
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::Iterator;
}
Expand description
A strongly-typed map in storage whose keys and values can be iterated over.
Required Associated Types§
sourcetype PrefixIterator: Iterator<Item = (K2, V)>
type PrefixIterator: Iterator<Item = (K2, V)>
The type that iterates over all (key2, value)
.
sourcetype Iterator: Iterator<Item = (K1, K2, V)>
type Iterator: Iterator<Item = (K1, K2, V)>
The type that iterates over all (key1, key2, value)
.
Required Methods§
sourcefn iter_prefix(
k1: impl EncodeLike<K1>,
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::PrefixIterator
fn iter_prefix(
k1: impl EncodeLike<K1>,
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::PrefixIterator
Enumerate all elements in the map with first key k1
in no particular
order. If you add or remove values whose first key is k1
to the map
while doing this, you’ll get undefined results.
sourcefn drain_prefix(
k1: impl EncodeLike<K1>,
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::PrefixIterator
fn drain_prefix(
k1: impl EncodeLike<K1>,
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::PrefixIterator
Remove all elements from the map with first key k1
and iterate through
them in no particular order. If you add elements with first key k1
to
the map while doing this, you’ll get undefined results.
sourcefn iter(
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::Iterator
fn iter(
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::Iterator
Enumerate all elements in the map in no particular order. If you add or remove values to the map while doing this, you’ll get undefined results.
sourcefn drain(
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::Iterator
fn drain(
max_iterations: Option<u32>,
start_key: Option<Vec<u8>>
) -> Self::Iterator
Remove all elements from the map and iterate through them in no particular order. If you add elements to the map while doing this, you’ll get undefined results.