ColorBackend

Trait ColorBackend 

Source
pub trait ColorBackend {
    // Required method
    fn write_styled<W>(
        &self,
        w: &mut W,
        text: &str,
        color: SemanticColor,
    ) -> Result<(), Error>
       where W: Write;

    // Provided method
    fn write_prefix<W>(
        &self,
        w: &mut W,
        prefix: char,
        color: SemanticColor,
    ) -> Result<(), Error>
       where W: Write { ... }
}
Expand description

A backend that decides how to render semantic colors.

Required Methods§

Source

fn write_styled<W>( &self, w: &mut W, text: &str, color: SemanticColor, ) -> Result<(), Error>
where W: Write,

Write styled text to the output.

Provided Methods§

Source

fn write_prefix<W>( &self, w: &mut W, prefix: char, color: SemanticColor, ) -> Result<(), Error>
where W: Write,

Write a diff prefix (-/+/←/→) with appropriate styling.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§