pub struct ProcessInfo {Show 13 fields
pub pid: u32,
pub ppid: u32,
pub name: String,
pub user: Option<String>,
pub cpu_percent: f64,
pub memory_kb: u64,
pub elapsed_seconds: u64,
pub start_time_unix_ms: Option<u64>,
pub exe_path: Option<String>,
pub state: ProcessState,
pub cmdline: Vec<String>,
pub env: Option<BTreeMap<String, String>>,
pub thread_count: Option<u32>,
}Expand description
Information about a single process.
All fields are populated on a best-effort basis. Fields that cannot be read
(e.g., due to permissions) are set to default values or None.
Fields§
§pid: u32Process ID.
ppid: u32Parent process ID.
name: StringProcess name (executable name, max 255 chars).
user: Option<String>Owner username (None if unavailable due to permissions).
cpu_percent: f64CPU usage normalized 0-100 across all cores.
Note: This is an instantaneous value and may be 0 for short-lived processes or processes that were just started.
memory_kb: u64Memory usage in kilobytes.
elapsed_seconds: u64Seconds since process start.
start_time_unix_ms: Option<u64>Process start time (Unix epoch milliseconds), when available.
Best-effort: omitted if the platform cannot provide it or access is denied.
exe_path: Option<String>Executable path (absolute), when available.
Best-effort: omitted if the platform cannot provide it or access is denied.
state: ProcessStateProcess state.
cmdline: Vec<String>Command line arguments.
May be empty if command line cannot be read (permissions, zombie process).
env: Option<BTreeMap<String, String>>Process environment variables (best-effort, opt-in via ProcessOptions).
thread_count: Option<u32>Thread count (best-effort, opt-in via ProcessOptions).
Trait Implementations§
Source§impl Clone for ProcessInfo
impl Clone for ProcessInfo
Source§fn clone(&self) -> ProcessInfo
fn clone(&self) -> ProcessInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more