Skip to main content

Crate inkferro_rt

Crate inkferro_rt 

Source
Expand description

inkferro-rt: line-diff transport.

A pure &str -> bytes port of ink’s createIncremental render path (ink/src/log-update.ts, ~lines 174-310). No terminal IO, no streams, no threads, no cursor-position machinery.

Scope (M2-E / M2 flicker policy): incremental rendering is the only mode. The TS createIncremental couples to a Writable stream only through .write() and cli-cursor, both pure terminal IO. With showCursor:true and no setCursorPosition, the cursor branch collapses: activeCursor stays undefined, cursorWasShown stays false, so returnPrefix and cursorSuffix are always "". The remaining render logic depends on the input string alone – no rows/columns terminal-height dependence – so the pure &str -> bytes contract holds.

Structs§

CursorPos
A terminal cursor position, mirroring ink’s CursorPosition (ink/src/cursor-helpers.ts:3-6, {x, y}). x/y are 0-based cell coordinates within the rendered frame; the napi boundary maps its u32 CursorPos onto this usize form for the escape arithmetic.
FrameParams
Per-frame inputs to FrameWriter::write_frame.
FrameWriter
Stateful frame emitter owning a LineDiff plus the small amount of cross-frame state ink keeps on its Ink instance.
LineDiff
Incremental line-diff transport: a stateful &str -> Vec<u8> writer that emits the minimal ANSI byte sequence to transform the previously rendered frame into the next one, mirroring ink’s createIncremental.

Constants§

bsu
Begin Synchronized Update (DECSET 2026): ESC [ ? 2026 h.
esu
End Synchronized Update (DECRST 2026): ESC [ ? 2026 l.

Functions§

should_clear_terminal_for_frame
Whether the next frame must perform a full terminal clear rather than an incremental diff.
should_synchronize
Whether synchronized output should wrap a write.