loom & weft
Made for Swift.

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

LOOM Unreleased (PR #2) / TERMINAL ALIASES FROM WEFT

ANSIBackend

Writes ANSI bytes to standard output and throws TerminalError.outputFailed on a failed write. It does not open raw mode or own a terminal session.

loom.ANSIBackend is an alias for weft.ANSIBackend. It is available through import loom. The underlying type’s members are documented here.

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

let backend = ANSIBackend()
_ = Terminal(backend: backend, width: 80, height: 24)
Members on this page

Feature guides and release status

ANSIBackend

Type Alias
typealias ANSIBackend = weft.weft.ANSIBackend

Writes ANSI bytes to standard output and throws TerminalError.outputFailed on a failed write. It does not open raw mode or own a terminal session.

Source · TerminalExports.swift:7

Underlying weft API

ANSIBackend

Structure
struct ANSIBackend

Conforms to: Backend.

Writes ANSI terminal output to standard output.

Source · ANSIBackend.swift:4

init()

Initializer
init()

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

Source · ANSIBackend.swift:5

write(_:)

Instance Method Throws
mutating func write(_ data: Data) throws

Writes every byte in order to standard output or throws an output error. Does not own the terminal session.

Parameters (1)
data
Bytes to write in order.
Source · ANSIBackend.swift:7