Crate pals[][src]

pals = Processes' Arguments LiSt

The main API is pals() which returns ProcList if succeeded.

let proc_list = pals::pals().unwrap();

ProcList can be regarded as a list of procs().

let proc_list = pals::pals().unwrap();
let procs = proc_list.procs();

The following items can be accessed:

  1. pid -- Process::pid.

  2. ppid -- Process::ppid.

  3. nul-terminated arguments in one single string -- Process::arguments.

  4. argument iterator -- Process::argv().

  5. parent process -- ProcList::parent_of().

let proc_list = pals::pals().unwrap();
let mut procs = proc_list.procs();
let first =;
println!( "pid:{:?}, ppid:{:?}",, first.ppid );
println!( "arguments:{}", first.arguments );
println!( "argv:\n{}", first
    .fold( String::new(),
        |acc,(i,arg)| format!( "{}\narg #{}:{}", acc, i, arg ))
println!( "parent's pid:{:?}", proc_list.parent_of( ));

ProcList can be regarded as a list of Proc trees.

Besides items mentioned above, the following extra items can be accessed:

  1. parent nodes -- Proc::parent().

  2. all child nodes -- Proc::children().

use pals::{Proc, pals};

pals().map( |proc_list| {
    fn assert_ppid_is_parent_pid( proc: Proc ) {
            .map( |parent| assert_eq!(, proc.ppid ));
            .for_each( |subproc| assert_ppid_is_parent_pid( subproc ));

        .for_each( |proc| assert_ppid_is_parent_pid( proc ))

ProcList can be converted to trees::Forest.

use pals::{Process, pals};
use trees::Forest;

let proc_list = pals().unwrap();

let bfs = proc_list
    .map( ToOwned::to_owned ); // &Process -> Process

let forest = Forest::<Process>::from( bfs );

Binary utility

See for more.



Process ID.


A process agent by which pid,ppid,arguments/argv, parent and child processes can be accessed.


Process list. It can be viewed as a list of process or a list of process trees.


Process holding pid, ppid, command name and arguments of one or more nul-terminated argument(s).



Dumps running processes' arguments into a list/forest.


Splits command line into arguments, aka argv, using rules defined on Windows platform. See this doc for more.