pub trait ConfigDiag {
    fn diag_is_verbose(&self) -> bool;

    fn diag_to_stderr(&self) -> bool { ... }
    fn diag<F>(&self, f: F)
    where
        F: FnOnce() -> String
, { ... } fn diag_(&self, msg: &str) { ... } }
Expand description

Provide a .diag() function for verbose output if requested. Useful for decorating configuration-like classes.

Required Methods

Has verbose output been requested?

Provided Methods

Should diagnostic messages go to the standard error stream? If overridden to return false, the messages are sent to the standard output stream instead.

Output a message to the standard error stream if requested. If the Self::diag_is_verbose method returns true, call the specified function to build a diagnostic message and write the latter to the stream selected by Self::diag_to_stderr.

Output a constant message to the standard error stream if requested. If the Self::diag_is_verbose method returns true, write the specified message to the stream selected by Self::diag_to_stderr.

Implementors