Skip to main content

proc_tree/
types.rs

1//! Data types for the process tree.
2
3/// Cached process info for a single PID.
4#[derive(Clone, Debug)]
5pub struct ProcInfo {
6    /// Command name (from `/proc/{pid}/comm`).
7    pub cmd: String,
8    /// Username (from UID lookup via `/etc/passwd`).
9    pub user: String,
10    /// Parent PID.
11    pub ppid: u32,
12    /// Thread group ID.
13    pub tgid: u32,
14    /// Process start time in nanoseconds since boot.
15    /// Used for PID reuse detection.
16    pub start_time_ns: u64,
17}
18
19/// A node in the process tree.
20#[derive(Clone, Debug)]
21pub struct PidNode {
22    pub ppid: u32,
23    pub cmd: String,
24}