pub struct CommandExecutor;Expand description
Executes command steps by running shell commands
Implementations§
Source§impl CommandExecutor
impl CommandExecutor
Sourcepub fn execute_command_step(
_workflow: &Workflow,
state: &mut WorkflowState,
step_id: &str,
command_step: &CommandStep,
) -> WorkflowResult<()>
pub fn execute_command_step( _workflow: &Workflow, state: &mut WorkflowState, step_id: &str, command_step: &CommandStep, ) -> WorkflowResult<()>
Execute a command step
Executes a shell command with the specified arguments and captures the output. Handles command timeouts and exit codes.
§Arguments
workflow- The workflow containing the stepstate- The current workflow statestep_id- The ID of the command step to executecommand_step- The command step configuration
§Returns
Returns Ok(()) if the command executed successfully, or an error if execution failed.
Sourcepub fn execute_command_step_with_timeout(
_workflow: &Workflow,
state: &mut WorkflowState,
step_id: &str,
command_step: &CommandStep,
timeout_ms: u64,
) -> WorkflowResult<()>
pub fn execute_command_step_with_timeout( _workflow: &Workflow, state: &mut WorkflowState, step_id: &str, command_step: &CommandStep, timeout_ms: u64, ) -> WorkflowResult<()>
Execute a command step with timeout
Executes a shell command with a specified timeout. If the command takes longer than the timeout, the execution is cancelled and an error is returned.
§Arguments
workflow- The workflow containing the stepstate- The current workflow statestep_id- The ID of the command step to executecommand_step- The command step configurationtimeout_ms- The timeout in milliseconds (overrides step timeout)
§Returns
Returns Ok(()) if the command executed successfully within the timeout,
or an error if execution failed or timed out.
Sourcepub fn get_command(command_step: &CommandStep) -> &str
pub fn get_command(command_step: &CommandStep) -> &str
Get the command from a command step
Sourcepub fn get_args(command_step: &CommandStep) -> &[String]
pub fn get_args(command_step: &CommandStep) -> &[String]
Get the arguments from a command step
Sourcepub fn get_timeout(command_step: &CommandStep) -> u64
pub fn get_timeout(command_step: &CommandStep) -> u64
Get the timeout from a command step
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