Skip to main content

run

Function run 

Source
pub fn run(
    args: &[String],
    out: &mut dyn Write,
    err: &mut dyn Write,
) -> Result<ExitCode, String>
Expand description

Run the CLI over args, writing to out and err.

Both streams are parameters rather than println! so that a test or a benchmark can drive the real command path and read back what it produced. Going through the binary instead measures process spawn and pipe setup alongside the work, and cannot assert on output without a subprocess.

§Errors

Returns the message the binary prints after oxml: , for usage mistakes and unreadable inputs. A document that is merely invalid is not an error here – it is a non-zero ExitCode.