pub trait ExecutionErrorTrait:
From<ExecutionError>
+ Debug
+ Error
+ Send
+ Sync
+ Sized
+ 'static {
// Required methods
fn new(
failure: ExecutionFailure,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
metadata: ExecutionErrorMetadata,
) -> Self;
fn with_command_index(self, command: CommandIndex) -> Self;
fn kind(&self) -> &ExecutionErrorKind;
fn command(&self) -> Option<CommandIndex>;
// Provided methods
fn from_execution_failure(failure: ExecutionFailure) -> Self { ... }
fn from_kind(kind: ExecutionErrorKind) -> Self { ... }
fn new_with_source<E>(kind: ExecutionErrorKind, source: E) -> Self
where E: Into<Box<dyn Error + Send + Sync + 'static>> { ... }
fn to_execution_failure(&self) -> ExecutionFailure { ... }
}Expand description
A trait for execution errors that provides common methods for accessing error information and creating new errors.
Required Methods§
fn new( failure: ExecutionFailure, source: Option<Box<dyn Error + Send + Sync + 'static>>, metadata: ExecutionErrorMetadata, ) -> Self
fn with_command_index(self, command: CommandIndex) -> Self
fn kind(&self) -> &ExecutionErrorKind
fn command(&self) -> Option<CommandIndex>
Provided Methods§
fn from_execution_failure(failure: ExecutionFailure) -> Self
fn from_kind(kind: ExecutionErrorKind) -> Self
fn new_with_source<E>(kind: ExecutionErrorKind, source: E) -> Self
fn to_execution_failure(&self) -> ExecutionFailure
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.