Plug Emulator into devtools 🎉
This commit is contained in:
parent
16556b51bc
commit
ed528c9c53
4 changed files with 158 additions and 32 deletions
|
|
@ -27,6 +27,7 @@ pub struct Emulator<P: Program> {
|
|||
#[allow(missing_debug_implementations)]
|
||||
pub enum Event<P: Program> {
|
||||
Action(Action<P::Message>),
|
||||
Ready,
|
||||
}
|
||||
|
||||
impl<P: Program + 'static> Emulator<P> {
|
||||
|
|
@ -58,6 +59,9 @@ impl<P: Program + 'static> Emulator<P> {
|
|||
runtime.run(stream.map(Event::Action).boxed());
|
||||
}
|
||||
|
||||
// TODO: Async boot environments
|
||||
runtime.send(Event::Ready);
|
||||
|
||||
Self {
|
||||
state,
|
||||
runtime,
|
||||
|
|
@ -144,6 +148,8 @@ impl<P: Program + 'static> Emulator<P> {
|
|||
for message in messages {
|
||||
self.update(program, message);
|
||||
}
|
||||
|
||||
self.runtime.send(Event::Ready);
|
||||
}
|
||||
|
||||
pub fn view(
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ pub mod simulator;
|
|||
|
||||
mod error;
|
||||
|
||||
pub use emulator::Emulator;
|
||||
pub use error::Error;
|
||||
pub use instruction::Instruction;
|
||||
pub use selector::Selector;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue