pub fn run_program(src: &str, input: &str) -> Result<String, String>Expand description
Run src as a complete program with input as its stdin and return
everything it wrote to stdout.
“Stdout” is the document’s text, as crate::run_text returns it and
texrs --text prints it; the \message stream and error reports are not
part of it. Each call runs on its own thread with fresh thread-local state,
so nothing leaks between calls and concurrent calls never mix output.
inputis the terminal (seecrate::expand::with_terminal): each of its lines answers one terminal read, which is what\read16,\read-1or a\readfrom any closed stream does (tex.web §484). The run starts in scroll mode so those reads are allowed. Running out of lines is tex’s*** (job aborted, no legal \end found).Errfor anythingcrate::run_textrefuses (an undefined control sequence, a fatal error, a failed Lua chunk) and for a panic in the engine.