Expand description
A more convenient interface than std::process::* for running external programs.
Structs§
- Capturing
- Which outputs and how they should be captured. Can’t clone, the
contained handles are not clonable; use
availablebefore consuming this if you need to retain the knowledge about available captures. - Outputs
- Wrapper around
Outputthat dereferences to it, but also offers atruthyfield, and implementsDisplayto show a multi-line message with both process status and its outputs.
Enums§
Functions§
- command_
with_ settings - run
- Run
cmdwithargumentsand the env overridden with the key-value pairs inset_env, wait for its completion. Returns an error if cmd exited with a code that is not inacceptable_status_codes. Returns true when 0 is in acceptable_status_codes and cmd exited with status 0, false for other accepted status codes.silencingspecifies captures that should be done, which are dropped unless there’s an error. - run_
output - run_
outputs - Same as
runbut captures outputs, returning (exited_0, stdout, stderr) - run_
stderr - Same as
runbut captures and returns stderr. - run_
stdout - Same as
runbut captures and returns stdout. - run_
stdout_ string - Same as
run_stdoutbut returns stdout as a utf-8 decoded string. - spawn
- Run
cmdwithargumentsand the env overridden with the key-value pairs inset_env, return aChildhandle (does not wait for its completion). If you don’t want to capture outputs, passCaptures::none()tocaptures. Note: if you just want to run a process in the background and are not actually reading from the filehandles inChild, then you definitely want to set this toCaptures::none(), because otherwise the outputs will go nowhere, or even block the child process after filling the pipe buffer.