pub struct Renderer { /* private fields */ }Expand description
Deterministic terminal renderer with a bounded width/theme-aware cell cache.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn lines(
&mut self,
state: &TuiState,
width: u16,
theme: &Theme,
) -> Vec<RenderedLine>
pub fn lines( &mut self, state: &TuiState, width: u16, theme: &Theme, ) -> Vec<RenderedLine>
Projects state into width-safe rows without mutating application state.
Sourcepub fn render(
&mut self,
state: &TuiState,
area: Rect,
buffer: &mut Buffer,
theme: &Theme,
)
pub fn render( &mut self, state: &TuiState, area: Rect, buffer: &mut Buffer, theme: &Theme, )
Renders one complete clipped frame into a Ratatui buffer with the cursor at the editor end.
Sourcepub fn render_with_cursor(
&mut self,
state: &TuiState,
area: Rect,
buffer: &mut Buffer,
theme: &Theme,
cursor_byte: usize,
)
pub fn render_with_cursor( &mut self, state: &TuiState, area: Rect, buffer: &mut Buffer, theme: &Theme, cursor_byte: usize, )
Renders one complete clipped frame into a Ratatui buffer.
Sourcepub fn cursor_position(
&mut self,
state: &TuiState,
width: u16,
height: u16,
cursor_byte: usize,
) -> Option<(u16, u16)>
pub fn cursor_position( &mut self, state: &TuiState, width: u16, height: u16, cursor_byte: usize, ) -> Option<(u16, u16)>
Returns the visible display-cell cursor position for the editor.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Removes all cached wrapped rows, for example after terminal reprobe.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
impl UnwindSafe for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more