#[non_exhaustive]pub enum TerminationError {
SignalFailed {
process_name: Cow<'static, str>,
attempt_errors: Vec<TerminationAttemptError>,
},
TerminationFailed {
process_name: Cow<'static, str>,
attempt_errors: Vec<TerminationAttemptError>,
},
}Expand description
Errors that can occur when terminating a process.
§Brief grace window after a failed signal send
During each graceful phase of crate::ProcessHandle::terminate, if the signal send itself
fails (EPERM on macOS, ESRCH on Linux against a not-yet-reaped process group on Unix; the
equivalent ERROR_INVALID_HANDLE / ERROR_ACCESS_DENIED window on Windows), the library
applies a fixed 100 ms grace and re-checks for child exit before escalating. This covers the
small race where the child has already exited but Tokio’s SIGCHLD reaper has not yet observed
it. The 100 ms grace replaces, never adds to, the user timeout for that phase. Real permission
denials and other genuine signal failures still surface here as SignalFailed or
TerminationFailed with the underlying io::Error preserved on each
TerminationAttemptError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SignalFailed
Failed to manually send a graceful signal to the process.
Fields
attempt_errors: Vec<TerminationAttemptError>Errors recorded while attempting to send the signal, in chronological order.
TerminationFailed
Failed to terminate the process after trying all platform termination signals.
Implementations§
Source§impl TerminationError
impl TerminationError
Sourcepub fn process_name(&self) -> &str
pub fn process_name(&self) -> &str
The name of the process involved in the termination error.
Sourcepub fn attempt_errors(&self) -> &[TerminationAttemptError]
pub fn attempt_errors(&self) -> &[TerminationAttemptError]
Errors recorded while attempting the operation, in chronological order.
Trait Implementations§
Source§impl Debug for TerminationError
impl Debug for TerminationError
Source§impl Display for TerminationError
impl Display for TerminationError
Source§impl Error for TerminationError
impl Error for TerminationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()