referrerpolicy=no-referrer-when-downgrade

frame_support/
instances.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18//! Some instance placeholder to be used in [`frame_support::pallet`] attribute macro.
19//!
20//! [`frame_support::pallet`] attribute macro does only requires the instance generic `I` to be
21//! static (contrary to `decl_*` macro which requires instance generic to implement
22//! [`frame_support::traits::Instance`]).
23//!
24//! Thus support provides some instance types to be used, This allow some instantiable pallet to
25//! depend on specific instance of another:
26//! ```
27//! # mod another_pallet { pub trait Config<I: 'static = ()> {} }
28//! pub trait Config<I: 'static = ()>: another_pallet::Config<I> {}
29//! ```
30//!
31//! NOTE: [`frame_support::pallet`] will reexport them inside the module, in order to make them
32//! accessible to [`frame_support::construct_runtime`].
33
34/// `Instance1` to be used for instantiable pallets defined with the
35/// [`#[pallet]`](`frame_support::pallet`) macro. Instances 2-16 are also available but are hidden
36/// from docs.
37#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
38pub struct Instance1;
39
40/// `Instance2` to be used for instantiable pallets defined with the `#[pallet]` macro.
41#[doc(hidden)]
42#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
43pub struct Instance2;
44
45/// `Instance3` to be used for instantiable pallets defined with the `#[pallet]` macro.
46#[doc(hidden)]
47#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
48pub struct Instance3;
49
50/// `Instance4` to be used for instantiable pallets defined with the `#[pallet]` macro.
51#[doc(hidden)]
52#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
53pub struct Instance4;
54
55/// `Instance5` to be used for instantiable pallets defined with the `#[pallet]` macro.
56#[doc(hidden)]
57#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
58pub struct Instance5;
59
60/// `Instance6` to be used for instantiable pallets defined with the `#[pallet]` macro.
61#[doc(hidden)]
62#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
63pub struct Instance6;
64
65/// `Instance7` to be used for instantiable pallets defined with the `#[pallet]` macro.
66#[doc(hidden)]
67#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
68pub struct Instance7;
69
70/// `Instance8` to be used for instantiable pallets defined with the `#[pallet]` macro.
71#[doc(hidden)]
72#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
73pub struct Instance8;
74
75/// `Instance9` to be used for instantiable pallets defined with the `#[pallet]` macro.
76#[doc(hidden)]
77#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
78pub struct Instance9;
79
80/// `Instance10` to be used for instantiable pallets defined with the `#[pallet]` macro.
81#[doc(hidden)]
82#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
83pub struct Instance10;
84
85/// `Instance11` to be used for instantiable pallets defined with the `#[pallet]` macro.
86#[doc(hidden)]
87#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
88pub struct Instance11;
89
90/// `Instance12` to be used for instantiable pallets defined with the `#[pallet]` macro.
91#[doc(hidden)]
92#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
93pub struct Instance12;
94
95/// `Instance13` to be used for instantiable pallets defined with the `#[pallet]` macro.
96#[doc(hidden)]
97#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
98pub struct Instance13;
99
100/// `Instance14` to be used for instantiable pallets defined with the `#[pallet]` macro.
101#[doc(hidden)]
102#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
103pub struct Instance14;
104
105/// `Instance15` to be used for instantiable pallets defined with the `#[pallet]` macro.
106#[doc(hidden)]
107#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
108pub struct Instance15;
109
110/// `Instance16` to be used for instantiable pallets defined with the `#[pallet]` macro.
111#[doc(hidden)]
112#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
113pub struct Instance16;