ProcessControl

Trait ProcessControl 

Source
pub trait ProcessControl {
    // Required method
    fn perform_process_action(
        &mut self,
        action: ProcessControlAction,
    ) -> impl Future<Output = Result<(), TaskError>>;

    // Provided methods
    fn stop_process(&mut self) -> impl Future<Output = Result<(), TaskError>> { ... }
    fn pause_process(&mut self) -> impl Future<Output = Result<(), TaskError>> { ... }
    fn resume_process(&mut self) -> impl Future<Output = Result<(), TaskError>> { ... }
}

Required Methods§

Source

fn perform_process_action( &mut self, action: ProcessControlAction, ) -> impl Future<Output = Result<(), TaskError>>

Performs a control action on the process or process group.

§Arguments
  • action - The control action to perform (stop, pause, resume)
§Returns
  • Ok(()) if the action was performed successfully
  • Err(TaskError) if the action fails
§Errors

Returns TaskError::Control if the process is not in a controllable state or if the requested action is not supported

Provided Methods§

Source

fn stop_process(&mut self) -> impl Future<Output = Result<(), TaskError>>

Requests the process to stop execution.

§Returns
  • Ok(()) if the stop signal was sent successfully
  • Err(TaskError) if stopping fails
Source

fn pause_process(&mut self) -> impl Future<Output = Result<(), TaskError>>

Requests the process to pause execution.

§Returns
  • Ok(()) if the pause signal was sent successfully
  • Err(TaskError) if pausing fails
Source

fn resume_process(&mut self) -> impl Future<Output = Result<(), TaskError>>

Requests the process to resume execution if it is paused.

§Returns
  • Ok(()) if the resume signal was sent successfully
  • Err(TaskError) if resuming fails

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§