Skip to main content

Present

Trait Present 

Source
pub trait Present: Serialize {
    // Required method
    fn present(&self) -> Document;

    // Provided methods
    fn message_kind(&self) -> MessageKind { ... }
    fn exit_code(&self) -> u8 { ... }
}
Expand description

A serializable domain model with one semantic human presentation.

Required Methods§

Source

fn present(&self) -> Document

Build the human document. JSON serializes self directly.

Provided Methods§

Source

fn message_kind(&self) -> MessageKind

Whether this value represents success or failure.

Source

fn exit_code(&self) -> u8

Process exit code. Typed protocols can distinguish usage errors from operational failures without changing their presentation stream.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§