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§
Sourcefn write_styled<W>(
&self,
w: &mut W,
text: &str,
color: SemanticColor,
) -> Result<(), Error>where
W: Write,
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§
Sourcefn write_prefix<W>(
&self,
w: &mut W,
prefix: char,
color: SemanticColor,
) -> Result<(), Error>where
W: Write,
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.