Skip to main content

Fault

Trait Fault 

Source
pub trait Fault: Error {
    // Required methods
    fn code(&self) -> &'static str;
    fn remediation(&self) -> String;

    // Provided methods
    fn step(&self) -> Option<&str> { ... }
    fn instance(&self) -> Option<&str> { ... }
    fn context(&self) -> ErrorContext { ... }
}
Expand description

Implemented by every error enum in every stackless crate.

A new error variant is only complete when its remediation text says what the operator should actually do (ARCHITECTURE.md §8).

Required Methods§

Source

fn code(&self) -> &'static str

The stable machine-readable code from codes.

Source

fn remediation(&self) -> String

How to proceed: a concrete command, flag, or fix.

Provided Methods§

Source

fn step(&self) -> Option<&str>

The lifecycle step that failed, when one was executing.

Source

fn instance(&self) -> Option<&str>

The instance the failure belongs to, when there is one.

Source

fn context(&self) -> ErrorContext

Structured observables for agents (command, log_path, log_tail, …).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§