Skip to main content

feed

Function feed 

Source
pub fn feed(
    command: &EngineCommand,
    input: &[u8],
) -> Result<String, EngineError>
Expand description

Runs command, writes input to its standard input and closes it, and returns what it printed to standard output, the way capture does, deadline and all.

The input is written on a thread of its own while the output is read, so a command that prints before it has read everything cannot leave both sides waiting on a full pipe.

ยงErrors

When the engine cannot be started, runs and fails, or does not answer in time.