How to store a process in rust -
i'd store std::io::process::process inside struct in rust. however, program goes defunct pass process instance struct. why that? code: use std::io::process::{command, process}; use std::rc::rc; use std::cell::refcell; struct dzeninst { process: rc<refcell<process>> //stdin: std::io::pipe::pipestream } impl dzeninst { // write string stdin of dzen fn write(&mut self, s : string) { let mut stdin = self.process.borrow_mut().stdin.take().unwrap(); println!("writing dzen inst"); match stdin.write_str((s + "\n").as_slice()) { err(why) => panic!("couldn't write dzen stdin: {}", why.desc), ok(_) => println!("wrote string dzen"), }; } } fn createdzen() -> dzeninst { dzeninst {process: rc::new(refcell::new( match command::new("dzen2").spawn() { err(why) => panic!("couldn't spawn ...