lxdb_format/version.rs
1/// Version of the LXDB binary format.
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub struct Version {
4 major: u16,
5 minor: u16,
6}
7
8impl Version {
9 pub const CURRENT: Self = Self::new(0, 1);
10
11 pub const fn new(major: u16, minor: u16) -> Self {
12 Self { major, minor }
13 }
14
15 pub const fn major(self) -> u16 {
16 self.major
17 }
18
19 pub const fn minor(self) -> u16 {
20 self.minor
21 }
22}
23
24impl Default for Version {
25 fn default() -> Self {
26 Self::CURRENT
27 }
28}