struct

C0::Record

Inherits Struct < Value < Object

Zero-copy accessor for a single record within a table. Fields are accessed by index, returning slices into the original buffer.

Constructors

new(buf : Bytes, start : Int32, end __arg0 : Int32)
Source

Instance methods

field(n : Int32) : Bytes

Access field by index. Scans for the Nth US separator. Respects STX/ETX nesting — US inside nested scopes is not a boundary.

Source
field_count

Number of fields in this record. Respects STX/ETX nesting — US inside nested scopes is not counted.

Source
fields

All fields as slices.

Source
list(n : Int32) : Array(Bytes)

Field n as a flat list: the items of its STX/ETX scope split on top-level US, each DLE-unescaped (mirrors #value). Inverse of Builder#list_field. A field that is not an STX/ETX scope is returned as a single-item list holding its value; an empty scope is an empty list.

Source
raw

Raw bytes of the entire record.

Source
value(n : Int32) : Bytes

Logical bytes of field n: the raw slice with DLE escapes decoded. Zero-copy when the field contains no escapes.

Source
values

All logical field values.

Source