Skip to main content

ProcessStore

Trait ProcessStore 

Source
pub trait ProcessStore {
    // Required methods
    fn get_process(&self, pid: u32) -> Option<ProcessInfo>;
    fn insert_process(&self, pid: u32, info: ProcessInfo);
    fn remove_process(&self, pid: u32) -> Option<ProcessInfo>;
    fn all_pids(&self) -> Vec<u32>;
    fn children_of(&self, pid: u32) -> Vec<u32>;
}
Expand description

Trait for process tree storage.

Implement this trait to provide your own storage backend.

Required Methods§

Source

fn get_process(&self, pid: u32) -> Option<ProcessInfo>

Get process info by PID.

Source

fn insert_process(&self, pid: u32, info: ProcessInfo)

Insert or update process info.

Source

fn remove_process(&self, pid: u32) -> Option<ProcessInfo>

Remove a process by PID. Returns the removed process info.

Source

fn all_pids(&self) -> Vec<u32>

Get all PIDs in the tree.

Source

fn children_of(&self, pid: u32) -> Vec<u32>

Get direct children of a PID.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§