pub trait Color {
// Required methods
fn bold(&self) -> String;
fn italic(&self) -> String;
fn warn(&self) -> String;
fn error(&self) -> String;
fn debug(&self) -> String;
fn info(&self) -> String;
}Expand description
Extension trait that adds ANSI color-formatting methods to any Display type.
This is intended for use inside log! calls to highlight important parts of
a message. All methods return a new String with the appropriate ANSI escape
codes applied.
§Examples
use webdav_server::log::Color;
let msg = "something went wrong".error();
let user = "user_42".bold();Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".