Contents

DataEntryRepresentable

A type that a model can produce and represent as a top-level transcript entry.

Declaration

protocol DataEntryRepresentable : Sendable

Overview

Conform to this protocol to describe how a value serializes into — and deserializes back from — a Transcript.DataEntry.

transcriptRepresentation is non-throwing: any fallible encoding should be surfaced from the conformer’s own initializer, where the developer is already deciding what input to accept. init(_:) is throwing because the wire representation may come from a persisted transcript, from over the network, or from any source the conformer doesn’t control, and could be malformed. The asymmetry mirrors Foundation’s String.init(data:encoding:) (failable) and String.utf8 (total).

Topics

Initializers

Instance Properties