Skip to main content

TerminalRenderer

Struct TerminalRenderer 

Source
pub struct TerminalRenderer { /* private fields */ }
Expand description

Stateful terminal renderer projecting a retained SceneTree into interactive ANSI diffs or static CLI plain text.

Implementations§

Source§

impl TerminalRenderer

Semantic scene projection, keyboard focus navigation, and incremental ANSI cell-diffing for TerminalRenderer.

Source

pub fn new() -> Self

Creates a fresh TerminalRenderer with empty diff history.

§Returns
  • Self - Initialized terminal renderer.
Source

pub fn invalidate(&mut self)

Clears cached previous frame state, forcing the next interactive render to emit a full synchronization frame.

§Arguments
  • &Self - Mutable terminal renderer.
Source

pub fn render_tree( &mut self, tree: &SceneTree, cols: u16, rows: u16, mode: TerminalRenderMode, ) -> (String, TerminalDiffStats)

Projects tree into a cols x rows character grid and emits either incremental ANSI TUI output or zero-ANSI static plain text.

§Arguments
  • &Self - Mutable terminal renderer.
  • &SceneTree - Retained UI scene tree to project.
  • u16 - Terminal viewport width in columns.
  • u16 - Terminal viewport height in rows.
  • TerminalRenderMode - Interactive TUI diff mode or static plain-text CLI mode.
§Returns
  • (String, TerminalDiffStats) - Rendered UTF-8 terminal payload and cell-diff telemetry.
Source

pub fn handle_key( &mut self, tree: &mut SceneTree, key: KeyEvent, ) -> TerminalNavAction

Processes a terminal keyboard event (Tab, Shift+Tab, arrows, Enter, Escape, Ctrl+C) against tree.

§Arguments
  • &Self - Mutable terminal renderer.
  • &mut SceneTree - Retained UI scene tree to update focus, scroll, or activation on.
  • KeyEvent - Normalized keyboard event.
§Returns
  • TerminalNavAction - Resulting focus, scroll, activation, or exit action.
Source§

impl TerminalRenderer

Source

pub fn get_mut_previous(&mut self) -> &mut Option<TerminalCellGrid>

Source

pub fn set_previous(&mut self, val: Option<TerminalCellGrid>) -> &mut Self

Source

pub fn get_current(&self) -> &TerminalCellGrid

Source

pub fn get_mut_current(&mut self) -> &mut TerminalCellGrid

Source

pub fn set_current(&mut self, val: TerminalCellGrid) -> &mut Self

Source

pub fn get_last_cols(&self) -> u16

Source

pub fn get_mut_last_cols(&mut self) -> &mut u16

Source

pub fn set_last_cols(&mut self, val: u16) -> &mut Self

Source

pub fn get_last_rows(&self) -> u16

Source

pub fn get_mut_last_rows(&mut self) -> &mut u16

Source

pub fn set_last_rows(&mut self, val: u16) -> &mut Self

Source

pub fn get_frames_rendered(&self) -> u64

Source

pub fn get_mut_frames_rendered(&mut self) -> &mut u64

Source

pub fn set_frames_rendered(&mut self, val: u64) -> &mut Self

Source

pub fn get_exit_requested(&self) -> bool

Source

pub fn get_mut_exit_requested(&mut self) -> &mut bool

Source

pub fn set_exit_requested(&mut self, val: bool) -> &mut Self

Trait Implementations§

Source§

impl Clone for TerminalRenderer

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TerminalRenderer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TerminalRenderer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for TerminalRenderer

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TerminalRenderer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.