pub fn find_by_user(store: &impl ProcessStore, target_user: &str) -> Vec<u32>Expand description
Find all PIDs whose user matches the given string.
use proc_tree::{DefaultStore, find_by_user, ProcessStore, ProcessInfo};
let store = DefaultStore::new(0);
store.insert_process(1, ProcessInfo::new("init".into(), "root".into(), 0, 1, 0));
store.insert_process(100, ProcessInfo::new("bash".into(), "alice".into(), 1, 100, 0));
assert_eq!(find_by_user(&store, "root"), vec![1]);
assert_eq!(find_by_user(&store, "alice"), vec![100]);
assert_eq!(find_by_user(&store, "nobody"), Vec::<u32>::new());