tauri_api::process

Trait ProcessExt

Source
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§

Source

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.

Source

fn kill(&self, signal: Signal) -> bool

Sends the given signal to the process.

Source

fn name(&self) -> &str

Returns the name of the process.

Source

fn cmd(&self) -> &[String]

Returns the command line.

Source

fn exe(&self) -> &Path

Returns the path to the process.

Source

fn pid(&self) -> i32

Returns the pid of the process.

Source

fn environ(&self) -> &[String]

Returns the environment of the process.

Always empty on Windows except for current process.

Source

fn cwd(&self) -> &Path

Returns the current working directory.

Always empty on Windows.

Source

fn root(&self) -> &Path

Returns the path of the root directory.

Always empty on Windows.

Source

fn memory(&self) -> u64

Returns the memory usage (in KiB).

Source

fn virtual_memory(&self) -> u64

Returns the virtual memory usage (in KiB).

Source

fn parent(&self) -> Option<i32>

Returns the parent pid.

Source

fn status(&self) -> ProcessStatus

Returns the status of the processus.

Source

fn start_time(&self) -> u64

Returns the time of process launch (in seconds).

Source

fn cpu_usage(&self) -> f32

Returns the total CPU usage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§