16 breaking releases
0.16.0 | Sep 26, 2024 |
---|---|
0.15.0 | Jul 18, 2024 |
0.14.0 | Jul 12, 2024 |
0.9.0 | Mar 18, 2024 |
0.0.0 | May 13, 2023 |
#20 in #append
340 downloads per month
Used in polkadot-sdk
2.5MB
44K
SLoC
Release
Polkadot SDK stable2409
lib.rs
:
Made with Substrate, for DotSama.
Paged List Pallet
A thin wrapper pallet around a paged_list::StoragePagedList
. It provides an API for a single
paginated list. It can be instantiated multiple times to provide multiple lists.
Overview
The pallet is quite unique since it does not expose any Call
s, Error
s or Event
s. All
interaction goes through the implemented StorageList
trait.
A fuzzer for testing is provided in crate pallet-paged-list-fuzzer
.
Examples
- Appending some data to the list can happen either by
Pallet::append_one
: - or by
Pallet::append_many
. This should always be preferred to repeated calls toPallet::append_one
: - If you want to append many values (ie. in a loop), then best use the
Pallet::appender
: - Iterating over the list can be done with
Pallet::iter
. It uses the standardIterator
trait: - Draining elements happens through the
Pallet::drain
iterator. Note that even peeking a value will already remove it.
Pallet API
None. Only things to consider is the Config
traits.
Low Level / Implementation Details
Implementation details are documented in paged_list::StoragePagedList
.
All storage entries are prefixed with a unique prefix that is generated by ListPrefix
.
Dependencies
~17–32MB
~523K SLoC