pub trait ProcessStatus<T, E>{
// Required methods
fn status_entry(&self) -> T;
fn status_exit(&self) -> T;
fn error_type(&self) -> E;
fn wrap_error<F: Error + Sync + Send + 'static>(
&self,
error: F,
message: Option<String>,
) -> E;
// Provided method
fn timeout_error(&self) -> E { ... }
}Expand description
Maps a process type to the status values and errors it should produce.
Implement this trait on an enum whose variants represent the distinct
processes you want to run (e.g. InitDb, StartDb, StopDb). The
executor calls these methods to produce typed status/error values without
knowing the concrete error type.
Required Methods§
Sourcefn status_entry(&self) -> T
fn status_entry(&self) -> T
Returns the status value that signals the process has entered execution.
Sourcefn status_exit(&self) -> T
fn status_exit(&self) -> T
Returns the status value that signals the process exited successfully.
Sourcefn error_type(&self) -> E
fn error_type(&self) -> E
Returns the error value for a generic process failure (non-zero exit, spawn error, etc.).
Provided Methods§
Sourcefn timeout_error(&self) -> E
fn timeout_error(&self) -> E
Returns the error value to use when the process exceeds its timeout.
Defaults to Self::error_type. Override to return a distinct
timeout-specific error variant.
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.