pub trait RenderTarget {
// Required methods
fn enter(&mut self) -> Result<()>;
fn exit(&mut self) -> Result<()>;
fn draw<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(&mut dyn RenderBackend);
// Provided method
fn repair(&mut self) -> Result<()> { ... }
}Expand description
Abstraction over the terminal output backend. Uses trait objects (dyn) at the compositor boundary for runtime flexibility. Performance: vtable indirection is dispatched once per frame/window, not per cell.
Required Methods§
fn enter(&mut self) -> Result<()>
fn exit(&mut self) -> Result<()>
fn draw<F>(&mut self, f: F) -> Result<()>where
F: FnOnce(&mut dyn RenderBackend),
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".