lutra-bin 0.6.0

Binary format library for Lutra: IR/RR encoding, decoding, and value representation
Documentation

module rr {
  ## Compiled program, executable with lutra-runner
  @std::rust_derive(["Debug", "Clone", "enum_as_inner::EnumAsInner"])
  type Program: enum {
    sql_postgres: SqlProgram,
    sql_duck_db: SqlProgram,
    bytecode_lt: project::br::Program,
  }

  ## Types of a program's input and output
  type ProgramType: {
    # Type of the program's input
    input: project::ir::Ty,

    # Type of the program's output
    output: project::ir::Ty,

    # Definitions that are referenced from input and output types.
    defs: [project::ir::TyDef],
  }

  ## SQL program, executable with lutra-runner-postgres
  type SqlProgram: {
    sql: Text,
    input_ty: project::ir::Ty,
    output_ty: project::ir::Ty,
    defs: [project::ir::TyDef],
  }
}

module layout {
  type EnumFormat: {
    tag_bytes: Uint8,
    inner_bytes: Uint8,
    has_ptr: Bool,
    variants: [EnumVariantFormat],
  }

  type EnumVariantFormat: {
    is_unit: Bool,
    padding_bytes: Uint8,
  }
}