Skip to main content

Status

Trait Status 

Source
pub trait Status: Send + Sync {
    // Required methods
    fn from_str(s: &str) -> Self;
    fn write_icon<W: Write>(&self, out: W, colors: &ColorScheme) -> Result<()>;
    fn is_passthrough(&self) -> bool;
}
Expand description

A trait that defines the behavior of a status.

This trait can be implemented to customize the icons and colors used in the console output.

Required Methods§

Source

fn from_str(s: &str) -> Self

Creates a Status from a string.

This is used by the console! macro to create a status from the level specified in the macro invocation.

Source

fn write_icon<W: Write>(&self, out: W, colors: &ColorScheme) -> Result<()>

Writes the icon for the status to the given writer.

Source

fn is_passthrough(&self) -> bool

Specify which status code can be used for passthrough printing, allowing to remove icons and styles when using the pass argument to the console! macro.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§