Trait sysinfo::ProcessExt
source · pub trait ProcessExt {
Show 14 methods
fn new(pid: Pid, parent: Option<Pid>, start_time: u64) -> Self;
fn kill(&self, signal: Signal) -> bool;
fn name(&self) -> &str;
fn cmd(&self) -> &[String];
fn exe(&self) -> &Path;
fn pid(&self) -> Pid;
fn environ(&self) -> &[String];
fn cwd(&self) -> &Path;
fn root(&self) -> &Path;
fn memory(&self) -> u64;
fn parent(&self) -> Option<Pid>;
fn status(&self) -> ProcessStatus;
fn start_time(&self) -> u64;
fn cpu_usage(&self) -> f32;
}
Expand description
Contains all the methods of the Process
struct.
Required Methods§
sourcefn new(pid: Pid, parent: Option<Pid>, start_time: u64) -> Self
fn new(pid: Pid, parent: Option<Pid>, start_time: u64) -> Self
Create a new process only containing the given information.
On windows, the start_time
argument is ignored.
sourcefn environ(&self) -> &[String]
fn environ(&self) -> &[String]
Returns the environment of the process.
Always empty on Windows except for current processus.
sourcefn status(&self) -> ProcessStatus
fn status(&self) -> ProcessStatus
Returns the status of the processus.
sourcefn start_time(&self) -> u64
fn start_time(&self) -> u64
Returns the time of process launch (in seconds).