Skip to main content

apply_to_each

Function apply_to_each 

Source
pub fn apply_to_each(
    processes: &[Process],
    act: impl FnMut(&Process) -> Result<()>,
) -> (Vec<Process>, Vec<(Process, String)>)
Expand description

Runs act on each process in order. Returns the processes it worked on and the ones it failed on (with the error text), each in the order given.

This is the loop kill, stop, freeze, thaw and orphans --kill share; taking the action as a parameter is what lets a test make it fail.