pub enum TaskStopReason {
Finished,
Terminated(TaskTerminateReason),
Error(TaskError),
}Expand description
Reason why a task stopped executing
Provides detailed information about why a process completed, whether due to natural completion, termination, or error.
§Exit Code Relationship
Finished: Process completed naturally - exit code isSome(code)Terminated(_): Process was killed - exit code isNoneError(_): Process encountered an error - exit code behavior varies
§Examples
use tcrm_task::tasks::{event::TaskStopReason, event::TaskTerminateReason};
// Natural completion
let reason = TaskStopReason::Finished;
// Terminated due to timeout
let reason = TaskStopReason::Terminated(TaskTerminateReason::Timeout);
// Terminated due to error
let reason = TaskStopReason::Error(tcrm_task::tasks::error::TaskError::IO("Process crashed".to_string()));Variants§
Finished
Process completed normally with an exit code
The process ran to completion and exited naturally.
Exit code will be Some(code) in the TaskEvent::Stopped event.
Terminated(TaskTerminateReason)
Process was terminated for a specific reason
The process was forcefully killed before natural completion.
Exit code will be None in the TaskEvent::Stopped event.
Error(TaskError)
Process stopped due to an error
An error occurred during execution or process management. Exit code behavior varies depending on the type of error.
Trait Implementations§
Source§impl Clone for TaskStopReason
impl Clone for TaskStopReason
Source§fn clone(&self) -> TaskStopReason
fn clone(&self) -> TaskStopReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TaskStopReason
impl Debug for TaskStopReason
Source§impl PartialEq for TaskStopReason
impl PartialEq for TaskStopReason
impl StructuralPartialEq for TaskStopReason
Auto Trait Implementations§
impl Freeze for TaskStopReason
impl RefUnwindSafe for TaskStopReason
impl Send for TaskStopReason
impl Sync for TaskStopReason
impl Unpin for TaskStopReason
impl UnwindSafe for TaskStopReason
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