gnuplot_wrapper/process/
gnuplot_live_process.rsuse std::{io::Write, process::Child};
use crate::process::gnuplot_process::GnuplotProcess;
pub struct GnuplotLiveProcess {
child: Child
}
impl GnuplotProcess for GnuplotLiveProcess {
fn new(child: Child) -> Self {
return GnuplotLiveProcess { child: child };
}
fn wait(&mut self) {
self.child.wait().unwrap();
}
}
impl GnuplotLiveProcess {
pub fn write(&mut self, command: &str) {
self.child.stdin.as_mut().unwrap().write_fmt(format_args!("{}\n", command)).unwrap();
}
}