pub trait BackendPresenter {
type Error: Debug + Display;
// Required methods
fn capabilities(&self) -> &TerminalCapabilities;
fn write_log(&mut self, text: &str) -> Result<(), Self::Error>;
fn present_ui(
&mut self,
buf: &Buffer,
diff: Option<&BufferDiff>,
full_repaint_hint: bool,
) -> Result<(), Self::Error>;
// Provided method
fn gc(&mut self) { ... }
}Expand description
Presentation abstraction: UI rendering and log output.
This is the output half of the backend boundary. The runtime hands a Buffer
(and optional BufferDiff) to the presenter, which emits platform-specific
output (ANSI escape sequences on native, DOM mutations on web).
Required Associated Types§
Required Methods§
Sourcefn capabilities(&self) -> &TerminalCapabilities
fn capabilities(&self) -> &TerminalCapabilities
Terminal capabilities detected by this backend.
Sourcefn write_log(&mut self, text: &str) -> Result<(), Self::Error>
fn write_log(&mut self, text: &str) -> Result<(), Self::Error>
Write a log line to the scrollback region (inline mode) or stderr.
Sourcefn present_ui(
&mut self,
buf: &Buffer,
diff: Option<&BufferDiff>,
full_repaint_hint: bool,
) -> Result<(), Self::Error>
fn present_ui( &mut self, buf: &Buffer, diff: Option<&BufferDiff>, full_repaint_hint: bool, ) -> Result<(), Self::Error>
Present a UI frame.
buf: the full rendered buffer for this frame.diff: optional pre-computed diff (backends may recompute ifNone).full_repaint_hint: iftrue, the backend should skip diffing and repaint everything.