pub trait Renderer: Send + Sync {
// Required methods
fn start(&mut self);
fn close(&mut self) -> Result<(), Box<dyn Error>>;
fn render(&mut self, view: View);
fn flush(&mut self, closing: bool) -> Result<(), Box<dyn Error>>;
fn reset(&mut self);
fn insert_above(&mut self, s: String) -> Result<(), Box<dyn Error>>;
fn resize(&mut self, width: usize, height: usize);
fn clear_screen(&mut self);
fn write_string(&mut self, s: &str) -> Result<usize, Box<dyn Error>>;
fn on_mouse(&mut self, msg: MouseMsg) -> Cmd;
fn set_optimizations(
&mut self,
hard_tabs: bool,
backspace: bool,
map_nl: bool,
);
fn set_color_profile(&mut self, p: Profile);
}Expand description
Renderer interface for Bubble Tea v2.0.8.
Required Methods§
Sourcefn close(&mut self) -> Result<(), Box<dyn Error>>
fn close(&mut self) -> Result<(), Box<dyn Error>>
Closes the renderer and flushes any remaining data.
Sourcefn flush(&mut self, closing: bool) -> Result<(), Box<dyn Error>>
fn flush(&mut self, closing: bool) -> Result<(), Box<dyn Error>>
Flushes renderer output buffer to terminal stdout.
Sourcefn insert_above(&mut self, s: String) -> Result<(), Box<dyn Error>>
fn insert_above(&mut self, s: String) -> Result<(), Box<dyn Error>>
Inserts unmanaged lines above the TUI renderer.
Sourcefn clear_screen(&mut self)
fn clear_screen(&mut self)
Clears terminal screen.
Sourcefn write_string(&mut self, s: &str) -> Result<usize, Box<dyn Error>>
fn write_string(&mut self, s: &str) -> Result<usize, Box<dyn Error>>
Write raw string to output.
Sourcefn set_optimizations(&mut self, hard_tabs: bool, backspace: bool, map_nl: bool)
fn set_optimizations(&mut self, hard_tabs: bool, backspace: bool, map_nl: bool)
Sets the cursor movement optimizations (hard tabs, backspace, newline mapping).
Sourcefn set_color_profile(&mut self, p: Profile)
fn set_color_profile(&mut self, p: Profile)
Sets the terminal color profile used for downsampling colors.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".