Debian Codegraph @

src/properties/group_number.rs

raw symbols SCIP
1 use super::Group;
2
3 impl Group {
4 /// Returns the group's number in the periodic table.
5 ///
6 /// ```
7 /// use mendeleev::Group;
8 /// assert_eq!(Group::IA.group_number(), 1);
9 /// assert_eq!(Group::VIIIA.group_number(), 18);
10 /// ```
11 pub const fn group_number(&self) -> u32 {
12 match self {
13 Group::IA => 1,
14 Group::IIA => 2,
15 Group::IIIB => 3,
16 Group::IVB => 4,
17 Group::VB => 5,
18 Group::VIB => 6,
19 Group::VIIB => 7,
20 Group::VIIIB8 => 8,
21 Group::VIIIB9 => 9,
22 Group::VIIIB10 => 10,
23 Group::IB => 11,
24 Group::IIB => 12,
25 Group::IIIA => 13,
26 Group::IVA => 14,
27 Group::VA => 15,
28 Group::VIA => 16,
29 Group::VIIA => 17,
30 Group::VIIIA => 18,
31 }
32 }
33 }