Skip to main content

CliFailureAlg

Trait CliFailureAlg 

Source
pub trait CliFailureAlg {
    // Required method
    fn cli_status(&self) -> NonZeroU8;

    // Provided method
    fn cli_reported(&self) -> bool { ... }
}
Expand description

States what a domain failure denotes on the command line: the status the command exits with.

A domain says this once for its own error type. The status is nonzero by its type, because zero is success.

Required Methods§

Source

fn cli_status(&self) -> NonZeroU8

The status a command failing with this error exits with.

Provided Methods§

Source

fn cli_reported(&self) -> bool

Whether the failure was already reported as it happened, so the exit carries only its status: cat reports each missing file and still reads the rest, and false reports nothing.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl CliFailureAlg for Infallible

An error that cannot be constructed has no status, so a command carrying one only succeeds.

Implementors§

Source§

impl<Error> CliFailureAlg for CliFailure<Error>