pub struct Compositor { /* private fields */ }Expand description
Double-buffered terminal renderer. Diffs current against previous
and flushes only changed cells; force_redraw triggers a full repaint.
Implementations§
Source§impl Compositor
impl Compositor
pub fn new(width: u16, height: u16) -> Self
pub fn resize(&mut self, width: u16, height: u16)
Sourcepub fn render_with<W: Write, F: FnOnce(&mut Grid, &Theme)>(
&mut self,
theme: &Theme,
w: &mut W,
paint: F,
) -> Result<()>
pub fn render_with<W: Write, F: FnOnce(&mut Grid, &Theme)>( &mut self, theme: &Theme, w: &mut W, paint: F, ) -> Result<()>
Render one frame. paint writes into current. The hardware caret
stays hidden for the lifetime of the app - any visible cursor is
painted into the grid as a styled cell, so it rides the diff atomically
with the rest of the frame and can never flicker through the
intermediate MoveTos that flush_diff emits between cell runs.
pub fn force_redraw(&mut self)
Auto Trait Implementations§
impl Freeze for Compositor
impl RefUnwindSafe for Compositor
impl Send for Compositor
impl Sync for Compositor
impl Unpin for Compositor
impl UnsafeUnpin for Compositor
impl UnwindSafe for Compositor
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