## Config

# Trait Config

Source

    pub trait Config: Config + Config<RuntimeEvent: From<Event<Self>>> {
        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 pezpallet.

The main purpose of this trait is to act as an interface between this pezpallet 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 pezpallet.

Consequently, a runtime that wants to include this pezpallet must implement this trait. The configuration trait of a pezpallet. Mandatory. Allows a pezpallet to receive types at a later point from the runtime that wishes to contain it. It allows the pezpallet to be parameterized over both types and values.

## Required Associated Constants§

Source

#### const ANOTHER_VALUE_PARAMETER: u32

Similar to `Config::ValueParameter`, but using `const`. Both are functionally equal, but offer different tradeoffs.

## Required Associated Types§

Source

#### type RuntimeEvent: IsType<<Self as Config>::RuntimeEvent> + From<Event<Self>>

A type that is not known now, but the runtime that will contain this pezpallet will know it later, therefore we define it here as an associated type.

Source

#### type ValueParameter: Get<u32>

A parameterize-able value that we receive later via the `Get<_>` trait.

## Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

## Implementors§

Source§

### impl Config for Runtime

Source§

#### const ANOTHER_VALUE_PARAMETER: u32 = 42u32

Source§

#### type RuntimeEvent = RuntimeEvent

Source§

#### type ValueParameter = ConstU32<42>