pub trait DisplayBackend: Write {
// Required methods
fn set_attributes(&mut self, attributes: Attributes) -> Result<()>;
fn set_fg(&mut self, color: Color) -> Result<()>;
fn set_bg(&mut self, color: Color) -> Result<()>;
// Provided method
fn write_styled(&mut self, styled: &Styled<dyn Display + '_>) -> Result<()> { ... }
}
Expand description
A trait to represent a terminal that can be rendered to without interaction.
Required Methods§
Sourcefn set_attributes(&mut self, attributes: Attributes) -> Result<()>
fn set_attributes(&mut self, attributes: Attributes) -> Result<()>
Sets the given attributes
removing ones which were previous applied.