chemistru_elements/table.rs
1#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
2pub struct TableData {
3 pub(crate) position: (u8, u8),
4}
5
6impl TableData {
7 #[must_use]
8 pub const fn group(self) -> u8 {
9 self.position.0
10 }
11
12 #[must_use]
13 pub const fn period(self) -> u8 {
14 self.position.1
15 }
16
17 #[must_use]
18 pub const fn new(position: (u8, u8)) -> Self {
19 Self { position }
20 }
21}