Skip to main content

topsoil_core/
instances.rs

1// This file is part of Soil.
2
3// Copyright (C) Soil contributors.
4// Copyright (C) Parity Technologies (UK) Ltd.
5// SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later WITH Classpath-exception-2.0
6
7//! Some instance placeholder to be used in [`topsoil_core::pallet`] attribute macro.
8//!
9//! [`topsoil_core::pallet`] attribute macro does only requires the instance generic `I` to be
10//! static (contrary to `decl_*` macro which requires instance generic to implement
11//! [`topsoil_core::traits::Instance`]).
12//!
13//! Thus support provides some instance types to be used, This allow some instantiable pallet to
14//! depend on specific instance of another:
15//! ```
16//! # mod another_pallet { pub trait Config<I: 'static = ()> {} }
17//! pub trait Config<I: 'static = ()>: another_pallet::Config<I> {}
18//! ```
19//!
20//! NOTE: [`topsoil_core::pallet`] will reexport them inside the module, in order to make them
21//! accessible to [`topsoil_core::construct_runtime`].
22
23/// `Instance1` to be used for instantiable pallets defined with the
24/// [`#[pallet]`](`topsoil_core::pallet`) macro. Instances 2-16 are also available but are hidden
25/// from docs.
26#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
27pub struct Instance1;
28
29/// `Instance2` to be used for instantiable pallets defined with the `#[pallet]` macro.
30#[doc(hidden)]
31#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
32pub struct Instance2;
33
34/// `Instance3` to be used for instantiable pallets defined with the `#[pallet]` macro.
35#[doc(hidden)]
36#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
37pub struct Instance3;
38
39/// `Instance4` to be used for instantiable pallets defined with the `#[pallet]` macro.
40#[doc(hidden)]
41#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
42pub struct Instance4;
43
44/// `Instance5` to be used for instantiable pallets defined with the `#[pallet]` macro.
45#[doc(hidden)]
46#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
47pub struct Instance5;
48
49/// `Instance6` to be used for instantiable pallets defined with the `#[pallet]` macro.
50#[doc(hidden)]
51#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
52pub struct Instance6;
53
54/// `Instance7` to be used for instantiable pallets defined with the `#[pallet]` macro.
55#[doc(hidden)]
56#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
57pub struct Instance7;
58
59/// `Instance8` to be used for instantiable pallets defined with the `#[pallet]` macro.
60#[doc(hidden)]
61#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
62pub struct Instance8;
63
64/// `Instance9` to be used for instantiable pallets defined with the `#[pallet]` macro.
65#[doc(hidden)]
66#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
67pub struct Instance9;
68
69/// `Instance10` to be used for instantiable pallets defined with the `#[pallet]` macro.
70#[doc(hidden)]
71#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
72pub struct Instance10;
73
74/// `Instance11` to be used for instantiable pallets defined with the `#[pallet]` macro.
75#[doc(hidden)]
76#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
77pub struct Instance11;
78
79/// `Instance12` to be used for instantiable pallets defined with the `#[pallet]` macro.
80#[doc(hidden)]
81#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
82pub struct Instance12;
83
84/// `Instance13` to be used for instantiable pallets defined with the `#[pallet]` macro.
85#[doc(hidden)]
86#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
87pub struct Instance13;
88
89/// `Instance14` to be used for instantiable pallets defined with the `#[pallet]` macro.
90#[doc(hidden)]
91#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
92pub struct Instance14;
93
94/// `Instance15` to be used for instantiable pallets defined with the `#[pallet]` macro.
95#[doc(hidden)]
96#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
97pub struct Instance15;
98
99/// `Instance16` to be used for instantiable pallets defined with the `#[pallet]` macro.
100#[doc(hidden)]
101#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)]
102pub struct Instance16;