Skip to main content

Module buffer

Module buffer 

Source
Expand description

Double buffering and cell-level diffing for flicker-free rendering. Maintains screen state to enable precise, minimal updates. Double buffering and cell-level diffing for flicker-free rendering.

This module implements a double-buffering system that maintains two complete representations of the terminal screen. By comparing these buffers cell-by-cell, we can generate minimal updates that eliminate flicker entirely.

§Architecture

    Current Screen          Next Frame           Diff Result
    ┌─────────────┐      ┌─────────────┐      ┌─────────────┐
    │ Hello World │      │ Hello Rust! │      │      ^^^^   │
    │ Terminal UI │      │ Terminal UI │      │ (no change) │
    └─────────────┘      └─────────────┘      └─────────────┘
       Front Buffer         Back Buffer          Cell Updates

Structs§

Cell
Represents a single cell in the terminal with its visual properties.
CellStyle
Style attributes that can be applied to a cell.
DoubleBuffer
Double buffer system for flicker-free rendering.
ScreenBuffer
A buffer representing the entire terminal screen as a 2D grid of cells.

Enums§

CellUpdate
Represents an update to one or more cells.