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.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<B: DisplayBackend> DisplayBackend for &mut B
impl<B: DisplayBackend> DisplayBackend for &mut B
Implementors§
impl DisplayBackend for TestBackend
impl<W: Write + AsFd> DisplayBackend for TermionBackend<W>
Available on crate feature
termion only.impl<W: Write> DisplayBackend for CrosstermBackend<W>
Available on crate feature
crossterm only.impl<W: Write> DisplayBackend for TermionDisplayBackend<W>
Available on crate feature
termion only.