pub struct GameShell<'a, C, R: Read, W: Write> { /* private fields */ }
Expand description
The main virtual machine wrapper for a game shell
This wrapper consumes an input and output stream through which it writes messages.
Implementations§
source§impl<'a, C, R: Read, W: Write> GameShell<'a, C, R, W>
impl<'a, C, R: Read, W: Write> GameShell<'a, C, R, W>
sourcepub fn new(context: C, reader: R, writer: W) -> Self
pub fn new(context: C, reader: R, writer: W) -> Self
Spawn a new gameshell with a given context and readers/writers.
sourcepub fn context_mut(&mut self) -> &mut C
pub fn context_mut(&mut self) -> &mut C
Get a mutable reference to the current context.
Trait Implementations§
source§impl<'a, C, R: Read, W: Write> IncConsumer for GameShell<'a, C, R, W>
impl<'a, C, R: Read, W: Write> IncConsumer for GameShell<'a, C, R, W>
source§fn consume(&mut self, output: &mut [u8]) -> Consumption
fn consume(&mut self, output: &mut [u8]) -> Consumption
Consume bytes and place them on an output stack
source§fn validate(&mut self, input: u8) -> Validation
fn validate(&mut self, input: u8) -> Validation
Validate part of the bytestream, as soon as we return
Validation::Ready
, process
will be run on the current accumulated bytes, after which these bytes will be deleted.