Skip to main content

ColorDisplay

Trait ColorDisplay 

Source
pub trait ColorDisplay {
    // Required method
    fn get_str(&self, display_type: DisplayType) -> String;
}
Expand description

Trait for converting colors to their ANSI escape sequences.

Required Methods§

Source

fn get_str(&self, display_type: DisplayType) -> String

Gets the ANSI escape sequence for the color.

§Arguments
  • &Self - Reference to self
  • DisplayType - Whether to apply to text or background
§Returns
  • String - The ANSI escape sequence string

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§