Skip to main content

string

Function string 

Source
pub fn string() -> BufferString
Available on crate feature process only.
Expand description

Buffer the output as a String. Will error if the output is not valid UTF-8.

ยงExample

use cu::pre::*;

let (hello, out) = cu::which("echo")?.command()
    .arg("Hello, world!")
    .stdout(cu::pio::string())
    .stdie_null()
    .spawn()?;

assert_eq!("Hello, world!\n", out.join()??);