MCPcopy Create free account
hub / github.com/elastio/devx / wait

Method wait

devx-cmd/src/lib.rs:538–548  ·  view source on GitHub ↗

Waits for the process to finish. Returns an error if the process has finished with non-zero exit code. You should use this method for processes spawned via [`Cmd::spawn()`] since the output of the command won't be read and returned, but just written to this process's `stdout` (as `stdout` is inherited with [`Cmd::spawn()`])

(&mut self)

Source from the content-addressed store, hash-verified

536 /// but just written to this process's `stdout` (as `stdout` is inherited
537 /// with [`Cmd::spawn()`])
538 pub fn wait(&mut self) -> Result<()> {
539 let exit_status = self.child.wait().proc_context(self)?;
540
541 if !exit_status.success() {
542 return Err(Error::proc(
543 &self,
544 &format_args!("Non-zero exit code: {}", exit_status),
545 ));
546 }
547 Ok(())
548 }
549
550 /// Same as [`Child::read()`] but reads any bytes sequence from the
551 /// child process `stdout`.

Callers 4

runMethod · 0.80
dropMethod · 0.80
read_bytesMethod · 0.80
readMethod · 0.80

Calls 1

proc_contextMethod · 0.80

Tested by

no test coverage detected