Skip to main content

Presentable

Trait Presentable 

Source
pub trait Presentable {
    // Required method
    fn present(
        &self,
        json: bool,
        show_secret: bool,
        to_stderr: bool,
    ) -> Result<(), CliError>;
}
Expand description

Presentable: implement to control how a result is shown.

  • json: pretty JSON when true, otherwise plain text
  • show_secret: allow printing secrets when applicable (may be ignored)
  • to_stderr: emit output to stderr instead of stdout

Required Methods§

Source

fn present( &self, json: bool, show_secret: bool, to_stderr: bool, ) -> Result<(), CliError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Presentable for Base58Result

Source§

fn present( &self, json: bool, _show_secret: bool, to_stderr: bool, ) -> Result<(), CliError>

Source§

impl Presentable for GenResult

Source§

fn present( &self, json: bool, show_secret: bool, to_stderr: bool, ) -> Result<(), CliError>

Source§

impl Presentable for SignResult

Source§

fn present( &self, json: bool, _show_secret: bool, to_stderr: bool, ) -> Result<(), CliError>

Source§

impl Presentable for VerifyResult

Source§

fn present( &self, json: bool, _show_secret: bool, to_stderr: bool, ) -> Result<(), CliError>

Implementors§