molgfx_core/dataset/
identity.rs1use core::fmt;
4
5#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
7pub struct DatasetId(u64);
8
9impl DatasetId {
10 pub const LEGACY: Self = Self(0);
13
14 #[must_use]
16 pub const fn new(value: u64) -> Self {
17 Self(value)
18 }
19
20 #[must_use]
22 pub const fn get(self) -> u64 {
23 self.0
24 }
25}
26
27impl fmt::Display for DatasetId {
28 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
29 self.0.fmt(formatter)
30 }
31}
32
33#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
35pub struct ChunkId(u64);
36
37impl ChunkId {
38 #[must_use]
40 pub const fn new(value: u64) -> Self {
41 Self(value)
42 }
43
44 #[must_use]
46 pub const fn get(self) -> u64 {
47 self.0
48 }
49}
50
51impl fmt::Display for ChunkId {
52 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
53 self.0.fmt(formatter)
54 }
55}
56
57#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
63pub struct ChunkOccurrenceId(u64);
64
65impl ChunkOccurrenceId {
66 #[must_use]
68 pub const fn new(value: u64) -> Self {
69 Self(value)
70 }
71
72 #[must_use]
74 pub const fn get(self) -> u64 {
75 self.0
76 }
77}
78
79impl fmt::Display for ChunkOccurrenceId {
80 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
81 self.0.fmt(formatter)
82 }
83}
84
85#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
87pub struct LogicalRow(u64);
88
89impl LogicalRow {
90 #[must_use]
92 pub const fn new(value: u64) -> Self {
93 Self(value)
94 }
95
96 #[must_use]
98 pub const fn get(self) -> u64 {
99 self.0
100 }
101}
102
103impl fmt::Display for LogicalRow {
104 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
105 self.0.fmt(formatter)
106 }
107}
108
109#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
111pub struct LocalRow(u32);
112
113impl LocalRow {
114 #[must_use]
116 pub const fn new(value: u32) -> Self {
117 Self(value)
118 }
119
120 #[must_use]
122 pub const fn get(self) -> u32 {
123 self.0
124 }
125}
126
127#[cfg(test)]
128#[path = "identity_tests.rs"]
129mod tests;