lib: introduce a VERSION constant, the daemon version

This commit is contained in:
Antoine Poinsot 2022-07-30 12:48:06 +02:00
parent fd86cfccee
commit 4b659bc35a
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304

View File

@ -54,6 +54,20 @@ fn setup_panic_hook() {
}));
}
#[derive(Debug, Clone)]
pub struct Version {
pub major: u32,
pub minor: u32,
}
impl fmt::Display for Version {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}.{}", self.major, self.minor)
}
}
pub const VERSION: Version = Version { major: 0, minor: 1 };
#[derive(Debug)]
pub enum StartupError {
Io(io::Error),