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

#21 in #append

Download history 34/week @ 2024-09-14 158/week @ 2024-09-21 72/week @ 2024-09-28 42/week @ 2024-10-05 115/week @ 2024-10-12 168/week @ 2024-10-19 191/week @ 2024-10-26 266/week @ 2024-11-02 18414/week @ 2024-11-09 25032/week @ 2024-11-16 26816/week @ 2024-11-23 20159/week @ 2024-11-30 24123/week @ 2024-12-07

99,988 downloads per month
Used in 9 crates (via polkadot-sdk)

Apache-2.0

2.5MB
44K SLoC

Release

Polkadot SDK stable2409


lib.rs:

Made with Substrate, for DotSama.

github - polkadot

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 Calls, Errors or Events. All interaction goes through the implemented StorageList trait.

A fuzzer for testing is provided in crate pallet-paged-list-fuzzer.

Examples

  1. Appending some data to the list can happen either by Pallet::append_one:
  2. or by Pallet::append_many. This should always be preferred to repeated calls to Pallet::append_one:
  3. If you want to append many values (ie. in a loop), then best use the Pallet::appender:
  4. Iterating over the list can be done with Pallet::iter. It uses the standard Iterator trait:
  5. 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
~525K SLoC