struct C0::Record

Overview

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

Defined in:

c0/table.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(buf : Bytes, start : Int32, end __arg0 : Int32) #

[View source]

Instance Method Detail

def 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.


[View source]
def field_count : Int32 #

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


[View source]
def fields : Array(Bytes) #

All fields as slices.


[View source]
def raw : Bytes #

Raw bytes of the entire record.


[View source]
def value(n : Int32) : Bytes #

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


[View source]
def values : Array(Bytes) #

All logical field values.


[View source]