pub struct CommandExecutor;Expand description
Command executor for running shell commands
Implementations§
Source§impl CommandExecutor
impl CommandExecutor
Sourcepub fn execute(
command_def: &CommandDefinition,
context: &CommandContext,
) -> Result<CommandExecutionResult>
pub fn execute( command_def: &CommandDefinition, context: &CommandContext, ) -> Result<CommandExecutionResult>
Execute a command with the given context
Sourcepub fn execute_and_get_output(
command_def: &CommandDefinition,
context: &CommandContext,
) -> Result<String>
pub fn execute_and_get_output( command_def: &CommandDefinition, context: &CommandContext, ) -> Result<String>
Execute a command and return only the output
Sourcepub fn execute_and_get_all_output(
command_def: &CommandDefinition,
context: &CommandContext,
) -> Result<(String, String)>
pub fn execute_and_get_all_output( command_def: &CommandDefinition, context: &CommandContext, ) -> Result<(String, String)>
Execute a command and return both stdout and stderr
Sourcepub fn validate_arguments(
command_def: &CommandDefinition,
arguments: &HashMap<String, String>,
) -> Result<()>
pub fn validate_arguments( command_def: &CommandDefinition, arguments: &HashMap<String, String>, ) -> Result<()>
Validate command arguments against the command definition
Sourcepub fn build_context_with_defaults(
command_def: &CommandDefinition,
arguments: HashMap<String, String>,
cwd: String,
) -> Result<CommandContext>
pub fn build_context_with_defaults( command_def: &CommandDefinition, arguments: HashMap<String, String>, cwd: String, ) -> Result<CommandContext>
Build a context with default values for missing arguments
Auto Trait Implementations§
impl Freeze for CommandExecutor
impl RefUnwindSafe for CommandExecutor
impl Send for CommandExecutor
impl Sync for CommandExecutor
impl Unpin for CommandExecutor
impl UnwindSafe for CommandExecutor
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