Add send to streams
This commit is contained in:
@@ -31,8 +31,8 @@ pub struct Machine {
|
|||||||
#[cfg(feature = "bonus:heap")]
|
#[cfg(feature = "bonus:heap")]
|
||||||
pub heap: Heap,
|
pub heap: Heap,
|
||||||
|
|
||||||
pub stream_in: Box<Read>,
|
pub stream_in: Box<Read + Send>,
|
||||||
pub stream_out: Rc<Mutex<Write>>,
|
pub stream_out: Rc<Mutex<Write + Send>>,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,11 +148,11 @@ impl Machine {
|
|||||||
Ok(self.block.read_u8()? as usize)
|
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;
|
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;
|
self.stream_out = outstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user