pub struct Process { /* private fields */ }Expand description
process: the arguments a run was given, its exit status, and the
executables the host allows it to start.
Implementations§
Source§impl Process
impl Process
Sourcepub fn real(args: Vec<String>, allowed: Vec<PathBuf>) -> Self
pub fn real(args: Vec<String>, allowed: Vec<PathBuf>) -> Self
The real process.
args are the arguments the host chose to pass on, not the host’s own
command line: a run sees what it was given and nothing else. allowed
is the list of executables run may start, each an absolute path.
An empty list is a process that can read its arguments and end
itself but cannot start anything, which is the only safe default a
host that knows nothing about the program can offer.
Sourcepub fn recorded(
args: Vec<String>,
outputs: BTreeMap<String, String>,
log: ProcessLog,
) -> Self
pub fn recorded( args: Vec<String>, outputs: BTreeMap<String, String>, log: ProcessLog, ) -> Self
A fake process that records what it was asked to do, for tests.
outputs maps an executable path to the standard output run should
answer with, and is also the allow-list: a program the fake has no
answer for is refused exactly as the real host refuses one the host
did not name.