MCPcopy Index your code
hub / github.com/assert-rs/assert_cmd / pipe_stdin

Method pipe_stdin

src/cmd.rs:120–126  ·  view source on GitHub ↗

Write `path`s content to `stdin` when the `Command` is run. Paths are relative to the [`env::current_dir`][env_current_dir] and not [`Command::current_dir`][Command_current_dir]. [env_current_dir]: std::env::current_dir() [Command_current_dir]: std::process::Command::current_dir()

(&mut self, file: P)

Source from the content-addressed store, hash-verified

118 /// [env_current_dir]: std::env::current_dir()
119 /// [Command_current_dir]: std::process::Command::current_dir()
120 pub fn pipe_stdin<P>(&mut self, file: P) -> io::Result<&mut Self>
121 where
122 P: AsRef<path::Path>,
123 {
124 let buffer = std::fs::read(file)?;
125 Ok(self.write_stdin(buffer))
126 }
127
128 /// Run a `Command`, returning an [`OutputResult`].
129 ///

Callers

nothing calls this directly

Calls 1

write_stdinMethod · 0.80

Tested by

no test coverage detected