#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ProcessInfo {
comm: String,
cmd: String,
user: String,
ppid: u32,
tgid: u32,
start_time_ns: u64,
}
impl ProcessInfo {
pub fn new(
comm: String,
cmd: String,
user: String,
ppid: u32,
tgid: u32,
start_time_ns: u64,
) -> Self {
Self {
comm,
cmd,
user,
ppid,
tgid,
start_time_ns,
}
}
pub fn comm(&self) -> &str {
&self.comm
}
pub fn cmd(&self) -> &str {
&self.cmd
}
pub fn user(&self) -> &str {
&self.user
}
pub fn ppid(&self) -> u32 {
self.ppid
}
pub fn tgid(&self) -> u32 {
self.tgid
}
pub fn start_time_ns(&self) -> u64 {
self.start_time_ns
}
}