ExecutionErrorTrait

Trait ExecutionErrorTrait 

Source
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§

Source

fn new( failure: ExecutionFailure, source: Option<Box<dyn Error + Send + Sync + 'static>>, metadata: ExecutionErrorMetadata, ) -> Self

Source

fn with_command_index(self, command: CommandIndex) -> Self

Source

fn kind(&self) -> &ExecutionErrorKind

Source

fn command(&self) -> Option<CommandIndex>

Provided Methods§

Source

fn from_execution_failure(failure: ExecutionFailure) -> Self

Source

fn from_kind(kind: ExecutionErrorKind) -> Self

Source

fn new_with_source<E>(kind: ExecutionErrorKind, source: E) -> Self
where E: Into<Box<dyn Error + Send + Sync + 'static>>,

Source

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.

Implementors§