Attribute Macro frame_support_procedural::generate_store
source · #[generate_store]
Expand description
To generate a Store
trait associating all storages, annotate your Pallet
struct with
the attribute #[pallet::generate_store($vis trait Store)]
, e.g.:
ⓘ
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);
More precisely, the Store
trait contains an associated type for each storage. It is
implemented for Pallet
allowing access to the storage from pallet struct.
Thus when defining a storage named Foo
, it can later be accessed from Pallet
using
<Pallet as Store>::Foo
.
NOTE: this attribute is only valid when applied directly to your Pallet
struct
definition.