Skip to content

std:text/StyledText

Canonical occurrence: protos/lib/text/StyledText.protos · Protos revision: e99b712ecf658a527b1fe82c8beba2c1286d8dc9.

Immutable styled text. A styled text is a frozen value that logically holds a flat sequence of text runs, each run a String with a std:text/Style. It carries no rendering, terminal, or encoding behavior of its own, and its runs are opaque: no slot, method, or other public operation exposes them.

Plain text has the "default" style. Empty text keeps no style: every logically empty styled text, styled or not, has the same content.

A styled text has no semantic equality or hash: == and hash are those of ordinary object identity.

Only values constructed by this module are styled texts. recognizes never invokes behavior of the candidate, so an object that merely has similar slots, parent, or shape is not a styled text.

This page lists the complete mechanically observable top-level slot inventory required by D067. Authored documentation, when present, is canonical D062 prose; mechanical presence alone does not create a stability or compatibility promise.

Answers a fresh frozen styled text holding text, which must be a String. With one argument the text is plain; with two, style must be a style recognized by std:text/Style. Any other argument signals an Error; no argument is converted, and null is not a style.

No callable shape is mechanically recorded for this slot.

Answers a fresh frozen styled text holding the content of every fragment, in argument order. Each fragment must be a String, which contributes plain text, or a styled text recognized by this module; any other fragment signals an Error. The result is always a styled text, including for no fragments or a single fragment.

No callable shape is mechanically recorded for this slot.

Answers true exactly when value is a styled text constructed by this module. Answers false for any other value, including this module and objects with the same slots or parent. The candidate is neither copied, converted, nor sent any message.

No callable shape is mechanically recorded for this slot.

Exact module source · Standard-library API · Standard library overview