Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Create the Shell trait #73

Open
sphinxc0re opened this issue Oct 4, 2017 · 0 comments
Open

Create the Shell trait #73

sphinxc0re opened this issue Oct 4, 2017 · 0 comments

Comments

@sphinxc0re
Copy link
Member

sphinxc0re commented Oct 4, 2017

Create a trait which allows devs to implement their own I/O system around the actual VM while using the same instruction set

trait Shell {
    type Error;

    /// Is called right before the VM executes code
    fn prepare(&mut self, &mut VM) -> Result<(), Self::Error>;
    /// Sends the given buffer to the shell
    fn send_buffer(&mut self, &Buffer) -> Result<(), Self::Error>;
    /// Receives and handles an event
    fn receive_event(&mut self, &Event) -> Result<(), Self::Error>;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant