Skip to main content

Module schema

Module schema 

Source
Expand description

Typed Column Schema.

define_columns! generates index constants, NUM_COLUMNS, and build_layout() from a single definition. One source of truth — indices and layout can’t drift from each other.

§Scalar columns

NAME: Typeconst NAME: usize = <offset>.

§Array columns

NAME: [Type; N]const NAME: usize = <base>. Offset advances by N.

§Example

define_columns! {
    pub FibColumns {
        A: B32,
        B: B32,
        Q: Bit,
    }
}

// FibColumns::A == 0
// FibColumns::B == 1
// FibColumns::Q == 2
// FibColumns::NUM_COLUMNS == 3
// FibColumns::build_layout() → [B32, B32, Bit]

Structs§

SchemaVec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums§

ColumnType
Column storage type, without the data itself. Mixed-field traces require the verifier to know the exact byte width of every opened column in order to parse the raw LDT bytes.

Functions§

chiplet_offsets
Cumulative column offsets from chiplet widths.