ableos/ableos/src/experiments/systeminfo.rs

22 lines
631 B
Rust
Raw Normal View History

2021-11-16 06:09:27 +00:00
// Can be standardized
// NOTE: move the file to the src/ dir
2022-04-11 22:23:11 +00:00
pub const KERNEL_VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(debug_assertions)]
/// A constant to check if the kernel is in debug mode
pub const RELEASE_TYPE: &str = "debug";
#[cfg(not(debug_assertions))]
/// A constant to check if the kernel is in release mode
pub const RELEASE_TYPE: &str = "release";
2021-11-16 06:09:27 +00:00
pub struct SystemMemory {
pub used: usize,
pub total: usize,
2021-11-16 06:09:27 +00:00
}
2022-04-11 22:23:11 +00:00
2021-11-16 06:09:27 +00:00
impl core::fmt::Display for SystemMemory {
2021-11-22 10:10:07 +00:00
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{} Bytes / {} Bytes", self.used, self.total)
}
2021-11-16 06:09:27 +00:00
}