Skip to main content

buffer

Function buffer 

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

Buffer the output as a Vec<u8>

ยงExample

use cu::pre::*;

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

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