1234567891011121314151617 |
- use systemstat::{saturating_sub_bytes, Platform, System};
- use crate::block::Block;
- pub struct Mem {}
- impl Block for Mem {
- fn display(&self) -> String {
- let sys = System::new();
- if let Ok(mem) = sys.memory() {
- format!("{}", saturating_sub_bytes(mem.total, mem.free))
- } else {
- "".to_string()
- }
- }
- }
|