pub struct Shell<'a> {
pub stdout: Box<dyn ReadWrite>,
pub stderr: Box<dyn ReadWrite>,
/* private fields */
}
Expand description
A shell for a game.
Fields§
§stdout: Box<dyn ReadWrite>
§stderr: Box<dyn ReadWrite>
Implementations§
Source§impl<'a> Shell<'a>
impl<'a> Shell<'a>
pub fn new() -> Self
Sourcepub fn register(
&mut self,
name: &'a str,
invokable: Box<dyn Invokable>,
) -> ShellResult<'_, ()>
pub fn register( &mut self, name: &'a str, invokable: Box<dyn Invokable>, ) -> ShellResult<'_, ()>
Registers a code to Shell. Returns CodeAlreadyExists if the code with provided name already exists in the shell.
Sourcepub fn unregister(&mut self, name: &'a str) -> ShellResult<'_, ()>
pub fn unregister(&mut self, name: &'a str) -> ShellResult<'_, ()>
Unregisters a code from Shell. Returns CodeDoesNotExist if the code with provided name does not exist in the shell.
Auto Trait Implementations§
impl<'a> Freeze for Shell<'a>
impl<'a> !RefUnwindSafe for Shell<'a>
impl<'a> !Send for Shell<'a>
impl<'a> !Sync for Shell<'a>
impl<'a> Unpin for Shell<'a>
impl<'a> !UnwindSafe for Shell<'a>
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