Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / RENDERING, VIEWPORTS, AND COMPOSITION
TestBackend
A headless physical terminal surface with scrollback and injectable partial-output failures.
Each resize, clear, cursor move, row paint and line feed is one primitive step. The failure counter restarts for each update; attempted updates are retained in history. This models semantic presentation and scrolling, not arbitrary ANSI terminal input.
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.
Members on this page
Feature guides and release status
TestBackend
struct TestBackendConforms to: RenderBackend, Swift.Sendable, Swift.SendableMetatype.
A headless physical terminal surface with scrollback and injectable partial-output failures.
Each resize, clear, cursor move, row paint and line feed is one primitive step. The failure counter restarts for each update; attempted updates are retained in history. This models semantic presentation and scrolling, not arbitrary ANSI terminal input.
Source · TestBackend.swift:25screen
var screen: Buffer { get }A public field of this type. Its value type and mutability are shown in the declaration.
Source · TestBackend.swift:26cursor
var cursor: Point? { get }The cursor position; see the type’s coordinate convention and lifecycle notes.
Source · TestBackend.swift:27scrollback
var scrollback: [Buffer] { get }A public field of this type. Its value type and mutability are shown in the declaration.
Source · TestBackend.swift:28operations
var operations: [RenderUpdate] { get }A public field of this type. Its value type and mutability are shown in the declaration.
Source · TestBackend.swift:29failure
var failure: TestBackendFailure?A public field of this type. Its value type and mutability are shown in the declaration.
Source · TestBackend.swift:30completedSteps
var completedSteps: Int { get }A public field of this type. Its value type and mutability are shown in the declaration.
Source · TestBackend.swift:31init(width:height:failure:)
init(width: Int = 80, height: Int = 24, failure: TestBackendFailure? = nil)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (3)
width- Available columns in terminal cells.
height- Available rows in terminal cells.
failure- Argument type and any default are shown in the declaration; see the behavior notes above.
reset()
mutating func reset()Resets encoder state.
This semantic backend has no encoder and retains its diagnostic history.
Source · TestBackend.swift:42clearHistory()
mutating func clearHistory()Clears diagnostic history while retaining the physical terminal contents and failure plan.
Source · TestBackend.swift:45render(_:)
mutating func render(_ update: RenderUpdate) throws -> RenderStatsApplies an update or throws at the configured primitive boundary.
Parameters (1)
update- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns RenderStats.