pub struct ScriptedShell { /* private fields */ }Expand description
A Shell implementation that drives the real spinner overlay using
pre-configured output scripts. No OS processes are spawned.
Intended for testing use. Enqueue one Script per expected
Shell::run_command call via ScriptedShell::push; each call pops the
front script and replays its events through the live overlay renderer,
letting you write overlay integration tests without real subprocesses.
Use ScriptedShell::with_config to supply a custom ShellConfig
(e.g. to change the overlay viewport height).
Implementations§
Source§impl ScriptedShell
impl ScriptedShell
Sourcepub fn with_config(self, config: ShellConfig) -> Self
pub fn with_config(self, config: ShellConfig) -> Self
Override the shell configuration (e.g. viewport_size).
Trait Implementations§
Source§impl Default for ScriptedShell
impl Default for ScriptedShell
Source§impl Shell for ScriptedShell
impl Shell for ScriptedShell
Source§fn run_command(
&self,
label: &str,
_program: &str,
_args: &[&str],
output: &mut dyn Output,
_mode: OutputMode,
) -> Result<CommandResult, ShellError>
fn run_command( &self, label: &str, _program: &str, _args: &[&str], output: &mut dyn Output, _mode: OutputMode, ) -> Result<CommandResult, ShellError>
Source§fn shell_exec(
&self,
_script: &str,
_output: &mut dyn Output,
_mode: OutputMode,
) -> Result<CommandResult, ShellError>
fn shell_exec( &self, _script: &str, _output: &mut dyn Output, _mode: OutputMode, ) -> Result<CommandResult, ShellError>
Run an arbitrary shell script string (passed to
bash -c / powershell -Command).Source§fn command_exists(&self, _program: &str) -> bool
fn command_exists(&self, _program: &str) -> bool
Return
true when program can be found on PATH.Source§fn command_output(
&self,
_program: &str,
_args: &[&str],
) -> Result<String, ShellError>
fn command_output( &self, _program: &str, _args: &[&str], ) -> Result<String, ShellError>
Run
program args and return its captured stdout as a trimmed String.Source§fn exec_capture(
&self,
_cmd: &str,
_output: &mut dyn Output,
_mode: OutputMode,
) -> Result<CommandResult, ShellError>
fn exec_capture( &self, _cmd: &str, _output: &mut dyn Output, _mode: OutputMode, ) -> Result<CommandResult, ShellError>
Run a shell command, capturing stdout/stderr silently without display.
In dry-run mode (
DryRunShell), logs the command and returns success without executing.Source§fn exec_interactive(
&self,
_cmd: &str,
_output: &mut dyn Output,
_mode: OutputMode,
) -> Result<(), ShellError>
fn exec_interactive( &self, _cmd: &str, _output: &mut dyn Output, _mode: OutputMode, ) -> Result<(), ShellError>
Run a shell command with inherited stdio (for interactive flows like
aws sso login).
In dry-run mode (DryRunShell), logs the command and returns success without executing.Auto Trait Implementations§
impl !Freeze for ScriptedShell
impl !RefUnwindSafe for ScriptedShell
impl Send for ScriptedShell
impl !Sync for ScriptedShell
impl Unpin for ScriptedShell
impl UnsafeUnpin for ScriptedShell
impl UnwindSafe for ScriptedShell
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