moon/fory Apache Fory · MoonBit

API · struct

RowCursor

Row format · defined at row.mbt:767

pub struct RowCursor {
  view : BytesView
  schema : RowSchema
  bitmap_size : Int32
  fixed : Int32
  base : Int32
}

A reader over one row's bytes, with random access to any field.

Build it from the same schema the row was written with, and from the bytes finish produced. base is normally zero; it is non-zero only when this cursor reads a nested struct inside a larger row.

Fields

FieldMeaning
view : BytesView

The bytes being read.

schema : RowSchema

The schema the row was written with, so that a field can be found without reading the ones in front of it.

bitmap_size : Int32

How many bytes of null bitmap the row begins with: the field count rounded up to eight bytes.

fixed : Int32

The width of one field's slot, eight bytes in this variant.

base : Int32

Where this row starts inside the buffer. Normally zero; non-zero only when a cursor reads a struct nested inside a larger row.

Methods

get_field

fn RowCursor::get_field(Self, Int32) -> RowValue raise

Read field i. A null field returns RowValue::Null; a variable field is read from the offset and size in its slot.

is_null

fn RowCursor::is_null(Self, Int32) -> Bool

Whether field i is null.

length

fn RowCursor::length(Self) -> Int32

The number of fields in the row.

new

fn RowCursor::new(BytesView, RowSchema, base? : Int32) -> Self

Open a cursor over a row's bytes. base defaults to zero for a top-level row.

Generated from src/pkg.generated.mbti and the doc comments beside this declaration.