heim_process/process/
memory.rs1use std::fmt;
2
3use heim_common::prelude::wrap;
4use heim_common::units::Information;
5
6use crate::sys;
7
8pub struct Memory(sys::Memory);
12
13wrap!(Memory, sys::Memory);
14
15impl Memory {
16 pub fn rss(&self) -> Information {
18 self.as_ref().rss()
19 }
20
21 pub fn vms(&self) -> Information {
23 self.as_ref().vms()
24 }
25}
26
27impl fmt::Debug for Memory {
28 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
29 f.debug_struct("Memory")
30 .field("rss", &self.rss())
31 .field("vms", &self.vms())
32 .finish()
33 }
34}