Trait polkadot_sdk_docs::polkadot_sdk::frame_runtime::pallet::Config
source · pub trait Config: Config {
type RuntimeEvent: IsType<<Self as Config>::RuntimeEvent> + From<Event<Self>>;
type ValueParameter: Get<u32>;
const ANOTHER_VALUE_PARAMETER: u32;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait. The configuration trait of a pallet. Mandatory. Allows a pallet to receive types at a later point from the runtime that wishes to contain it. It allows the pallet to be parameterized over both types and values.
Required Associated Types§
sourcetype RuntimeEvent: IsType<<Self as Config>::RuntimeEvent> + From<Event<Self>>
type RuntimeEvent: IsType<<Self as Config>::RuntimeEvent> + From<Event<Self>>
A type that is not known now, but the runtime that will contain this pallet will know it later, therefore we define it here as an associated type.
sourcetype ValueParameter: Get<u32>
type ValueParameter: Get<u32>
A parameterize-able value that we receive later via the Get<_>
trait.
Required Associated Constants§
sourceconst ANOTHER_VALUE_PARAMETER: u32
const ANOTHER_VALUE_PARAMETER: u32
Similar to Config::ValueParameter
, but using const
. Both are functionally
equal, but offer different tradeoffs.