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§
Sourcefn perform_process_action(
&mut self,
action: ProcessControlAction,
) -> impl Future<Output = Result<(), TaskError>>
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 successfullyErr(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§
Sourcefn stop_process(&mut self) -> impl Future<Output = Result<(), TaskError>>
fn stop_process(&mut self) -> impl Future<Output = Result<(), TaskError>>
Requests the process to stop execution.
§Returns
Ok(())if the stop signal was sent successfullyErr(TaskError)if stopping 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.