loom & weft
Made for Swift.

Published release 0.2.1. Unreleased PR #2 reference.

LOOM 0.2.1 / RENDERING, VIEWPORTS, AND COMPOSITION

LayoutCache

A caller-owned bounded least-recently-used layout cache.

No global state is retained.

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

LayoutCache

Structure
struct LayoutCache

Conforms to: Swift.Sendable, Swift.SendableMetatype.

A caller-owned bounded least-recently-used layout cache.

No global state is retained.

Source · LayoutCache.swift:14

capacity

Instance Property
let capacity: Int

A public field of this type. Its value type and mutability are shown in the declaration.

Source · LayoutCache.swift:15

count

Instance Property
var count: Int { get }

A public field of this type. Its value type and mutability are shown in the declaration.

Source · LayoutCache.swift:16

init(capacity:)

Initializer
init(capacity: Int = 128)

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

Parameters (1)
capacity
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · LayoutCache.swift:25

removeAll()

Instance Method
mutating func removeAll()

Removes all retained layout results.

Source · LayoutCache.swift:29

split(_:area:)

Instance Method
mutating func split(_ layout: Layout, area: Rect) -> [Rect]

Includes every layout field and the complete input rectangle in the key.

Parameters (2)
layout
Argument type and any default are shown in the declaration; see the behavior notes above.
area
Assigned absolute terminal-cell rectangle.

Returns [Rect].

Source · LayoutCache.swift:34