use crate::model::ErrRec;
use crate::tui::core::AppState;
impl AppState {
pub fn sys_err_rec(&self) -> Option<&ErrRec> {
self.core.sys_err.as_ref()
}
pub fn show_sys_states(&self) -> bool {
self.core.show_sys_states
}
pub fn memory(&self) -> u64 {
self.core.memory
}
#[allow(unused)]
pub fn cpu(&self) -> f64 {
self.core.cpu
}
}
impl AppState {
pub(in crate::tui::core) fn toggle_show_sys_states(&mut self) {
self.core.show_sys_states = !self.core.show_sys_states;
}
pub(in crate::tui::core) fn refresh_sys_state(&mut self) {
let (memory, cpu) = self.core.sys_state.memory_and_cpu();
self.core.memory = memory;
self.core.cpu = cpu;
}
}