pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn new(shell: Shell, python: Option<Box<dyn PythonEngine>>) -> Self
Sourcepub fn reset_transient(&mut self)
pub fn reset_transient(&mut self)
Clears per-invocation control-flow signals. A stray exit/break/
continue (e.g. leaked from a script or function body) used to persist
on the long-lived Runtime, so every later multi-command input ran only
its first segment. Host entry points must call this before each command.
Sourcepub fn execute_top(&mut self, input: &str) -> CommandOutput
pub fn execute_top(&mut self, input: &str) -> CommandOutput
Top-level command entry for hosts: resets leaked control-flow state,
then executes. Nesting uses Self::execute directly.
Sourcepub fn execute(&mut self, input: &str) -> CommandOutput
pub fn execute(&mut self, input: &str) -> CommandOutput
Top-level entry: splits the input into logical segments (newlines, ;,
&&, ||, heredocs) and executes them with shell chaining semantics.
Sourcepub fn execute_with_cwd(&mut self, cwd: &str, input: &str) -> CommandOutput
pub fn execute_with_cwd(&mut self, cwd: &str, input: &str) -> CommandOutput
Executes input with cwd as the working directory, restoring the
previous cwd afterwards. Used by hosts (e.g. the Android app UI) so
concurrent callers don’t depend on — or pollute — the shared cwd.
Source§impl Runtime
impl Runtime
pub fn python_available(&self) -> bool
pub fn python_engine_ref(&self) -> Option<&(dyn PythonEngine + '_)>
pub fn execute_python_code(&mut self, code: &str) -> CommandOutput
pub fn execute_python_script(&mut self, script_path: &str) -> CommandOutput
pub fn shell_root_dir(&self) -> PathBuf
Sourcepub fn vfs_cwd(&self) -> PathBuf
pub fn vfs_cwd(&self) -> PathBuf
Returns the VFS absolute path for the current working directory.