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.Auto Trait Implementations§
impl<'a, C, R, W> Freeze for GameShell<'a, C, R, W>
impl<'a, C, R, W> RefUnwindSafe for GameShell<'a, C, R, W>
impl<'a, C, R, W> Send for GameShell<'a, C, R, W>
impl<'a, C, R, W> Sync for GameShell<'a, C, R, W>
impl<'a, C, R, W> Unpin for GameShell<'a, C, R, W>
impl<'a, C, R, W> UnwindSafe for GameShell<'a, C, R, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more