polkadot_runtime_common/slot_range.rs
1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Polkadot.
3
4// Polkadot is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Polkadot is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
16
17//! The `SlotRange` struct which succinctly handles the 36 values that
18//! represent all sub ranges between 0 and 7 inclusive.
19
20slot_range_helper::generate_slot_range!(
21 Zero(0),
22 One(1),
23 Two(2),
24 Three(3),
25 Four(4),
26 Five(5),
27 Six(6),
28 Seven(7)
29);
30
31// Will generate:
32// pub enum SlotRange {
33// ZeroZero, 0
34// ZeroOne, 1
35// ZeroTwo, 2
36// ZeroThree, 3
37// ZeroFour, 4
38// ZeroFive, 5
39// ZeroSix, 6
40// ZeroSeven, 7
41// OneOne, 8
42// OneTwo, 9
43// OneThree, 10
44// OneFour, 11
45// OneFive, 12
46// OneSix, 13
47// OneSeven, 14
48// TwoTwo, 15
49// TwoThree, 16
50// TwoFour, 17
51// TwoFive, 18
52// TwoSix, 19
53// TwoSeven, 20
54// ThreeThree, 21
55// ThreeFour, 22
56// ThreeFive, 23
57// ThreeSix, 24
58// ThreeSeven, 25
59// FourFour, 26
60// FourFive, 27
61// FourSix, 28
62// FourSeven, 29
63// FiveFive, 30
64// FiveSix, 31
65// FiveSeven, 32
66// SixSix, 33
67// SixSeven, 34
68// SevenSeven, 35
69// }