Add send to streams

This commit is contained in:
2018-05-23 20:30:10 +02:00
parent b591a3eba1
commit 071921a9cf

View File

@@ -31,8 +31,8 @@ pub struct Machine {
#[cfg(feature = "bonus:heap")]
pub heap: Heap,
pub stream_in: Box<Read>,
pub stream_out: Rc<Mutex<Write>>,
pub stream_in: Box<Read + Send>,
pub stream_out: Rc<Mutex<Write + Send>>,
}
@@ -148,11 +148,11 @@ impl Machine {
Ok(self.block.read_u8()? as usize)
}
pub fn set_input(&mut self, instream: Box<Read>) {
pub fn set_input(&mut self, instream: Box<Read + Send>) {
self.stream_in = instream;
}
pub fn set_output(&mut self, outstream: Rc<Mutex<Write>>) {
pub fn set_output(&mut self, outstream: Rc<Mutex<Write + Send>>) {
self.stream_out = outstream;
}
}