loom & weft
Made for Swift.

Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.

LOOM Unreleased (PR #2) / RENDERING AND LAYOUT

RenderStats

Rendering counters with a public initializer. ANSI changedCells counts visited changed cells (including continuations); bytes counts emitted UTF-8 bytes including controls. TestBackend reports physical changes, so its counts have different semantics. Counts are diagnostics, not performance guarantees.

Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.

Example

var terminal = Terminal(backend: ANSIBackend(), width: 10, height: 2)
let stats = try terminal.draw { _ in }
_ = (stats.changedCells, stats.bytes)
Members on this page

Feature guides and release status

RenderStats

Structure
struct RenderStats

Conforms to: Swift.Sendable, Swift.SendableMetatype.

The emitted cells (including requested redraws) and bytes in one rendering pass.

Source · RenderStats.swift:2

changedCells

Instance Property
let changedCells: Int

Count of differing cells visited by this encoding pass.

Source · RenderStats.swift:3

bytes

Instance Property
let bytes: Int

Number of encoded UTF-8 output bytes.

Source · RenderStats.swift:4

init(changedCells:bytes:)

Initializer
init(changedCells: Int, bytes: Int)

Creates a value with the supplied arguments. Default arguments are shown in the declaration.

Parameters (2)
changedCells
Argument type and any default are shown in the declaration; see the behavior notes above.
bytes
Input bytes to decode incrementally.
Source · RenderStats.swift:6