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

Method write_stdin

src/cmd.rs:88–94  ·  view source on GitHub ↗

Write `buffer` to `stdin` when the `Command` is run. # Examples ```rust use assert_cmd::Command; let mut cmd = Command::new("cat") .arg("-et") .write_stdin("42") .assert() .stdout("42"); ```

(&mut self, buffer: S)

Source from the content-addressed store, hash-verified

86 /// .stdout("42");
87 /// ```
88 pub fn write_stdin<S>(&mut self, buffer: S) -> &mut Self
89 where
90 S: Into<Vec<u8>>,
91 {
92 self.stdin = Some(bstr::BString::from(buffer.into()));
93 self
94 }
95
96 /// Error out if a timeout is reached
97 ///

Callers 2

pipe_stdinMethod · 0.80
lib_exampleFunction · 0.80

Calls

no outgoing calls

Tested by 1

lib_exampleFunction · 0.64