1 //! Module providing a helper structure to capture output in subprocesses.
9 pub struct Sink(Arc<Mutex<Vec<u8>>>);
12 pub fn new_boxed(data: &Arc<Mutex<Vec<u8>>>) -> Box<Self> {
13 Box::new(Self(data.clone()))
18 fn write(&mut self, data: &[u8]) -> io::Result<usize> {
19 Write::write(&mut *self.0.lock().unwrap(), data)
21 fn flush(&mut self) -> io::Result<()> {