Skip to main content

Process

Trait Process 

Source
pub trait Process {
    // Required methods
    fn pid(&self) -> NonZeroU32;
    fn executable_path(&self) -> Option<PathBuf>;
    fn name(&self) -> &str;

    // Provided method
    fn cmdline(&self) -> &[String] { ... }
}
Expand description

A running process

Used to identify running applications. ApplicationEntry’s exec field is compared against the process’s executable path to determine if the process is an application.

Required Methods§

Source

fn pid(&self) -> NonZeroU32

The process’s PID

Source

fn executable_path(&self) -> Option<PathBuf>

The process’s executable path

It is expected that the path is canonical

Source

fn name(&self) -> &str

The process’s name

Essentially the name of the process as seen in ps

Provided Methods§

Source

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

The process’s full argv as read from /proc/<pid>/cmdline

Used to disambiguate processes that share an executable between multiple applications (e.g. Chromium-based PWAs, custom launcher shortcuts for the same binary with different args). Returning an empty slice disables argv disambiguation for this process; matching degrades to “binary path only”, so processes in shared-binary buckets will be dropped rather than attributed arbitrarily.

Implementors§