pub struct Shell {
pub stack: Stack,
/* private fields */
}
Expand description
An interactive shell that runs glue commands using a stack. Commands are incrementally added and executed as they are passed to cin from prompt.
Fields§
§stack: Stack
The Stack
instance of the shell.
This instance lives for the entire Shell
instance lifetime.
Implementations§
Source§impl Shell
impl Shell
Sourcepub async fn start(&mut self)
pub async fn start(&mut self)
Start the prompt loop asynchronously. The loop executes a glue command
at each iteration, or ends when a None
is provided as command.
Note that a None
command equals to a prompt with a exit
or quit
string: empty string will just be ignored and the loop will continue.
Sourcepub fn load_file(&mut self, path: String) -> Result<(), String>
pub fn load_file(&mut self, path: String) -> Result<(), String>
Load content of a file into the execution stack.
Sourcepub async fn execute_all(&mut self) -> Result<(), String>
pub async fn execute_all(&mut self) -> Result<(), String>
Execute all runners in the stack consecutively.
Auto Trait Implementations§
impl Freeze for Shell
impl RefUnwindSafe for Shell
impl Send for Shell
impl Sync for Shell
impl Unpin for Shell
impl UnwindSafe for Shell
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