pub trait ProcessExt {
Show 15 methods
// Required methods
fn new(pid: i32, parent: Option<i32>, 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) -> i32;
fn environ(&self) -> &[String];
fn cwd(&self) -> &Path;
fn root(&self) -> &Path;
fn memory(&self) -> u64;
fn virtual_memory(&self) -> u64;
fn parent(&self) -> Option<i32>;
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: i32, parent: Option<i32>, start_time: u64) -> Self
fn new(pid: i32, parent: Option<i32>, 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 process.
Sourcefn virtual_memory(&self) -> u64
fn virtual_memory(&self) -> u64
Returns the virtual memory usage (in KiB).
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).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".