Expand description
Used for storing total or available RAM and Swap.
Fields§
§ram: f32§swap: f32Implementations§
source§impl Memory
impl Memory
sourcepub fn get_total() -> Result<Memory, Error>
pub fn get_total() -> Result<Memory, Error>
Returns Memory instance storing total RAM and total Swap
sourcepub fn format(mem_in_kb: f32) -> String
pub fn format(mem_in_kb: f32) -> String
Returns argument, given in kb, formatted to suitable unit.
sourcepub fn save_with_unit(&mut self)
pub fn save_with_unit(&mut self)
Formats RAM and Swap to suitable units, saving the result to struct’s fields for cheaper usage
sourcepub fn get_ram_with_unit(&self) -> &str
pub fn get_ram_with_unit(&self) -> &str
Returns the RAM with unit as a &str
sourcepub fn get_swap_with_unit(&self) -> &str
pub fn get_swap_with_unit(&self) -> &str
Returns the Swap with unit as a &str