Skip to main content

RenderTarget

Trait RenderTarget 

Source
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§

Source

fn enter(&mut self) -> Result<()>

Source

fn exit(&mut self) -> Result<()>

Source

fn draw<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(&mut dyn RenderBackend),

Provided Methods§

Source

fn repair(&mut self) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§