Milky2018/wasm_core/types does not have a README file

    FromInt64

    pub trait FromInt64 {
    fn from_int64_bits(Int64) -> Self
    }

    impl FromInt64 for Int
    impl FromInt64 for Int64
    impl FromInt64 for Float
    impl FromInt64 for Double

    ToInt64

    pub trait ToInt64 {
    fn to_int64_bits(Self) -> Int64
    }

    impl ToInt64 for Int
    impl ToInt64 for Int64
    impl ToInt64 for Float
    impl ToInt64 for Double

    ArrayType

    pub(all) struct ArrayType {
    element : FieldType
    } derive(Eq,
    Debug
    )

    Array type definition

    ArrayType::equal

    fn ArrayType::equal(ArrayType, ArrayType) -> Bool

    ArrayType::not_equal

    fn ArrayType::not_equal(x : ArrayType, y : ArrayType) -> Bool

    BlockType

    pub(all) enum BlockType {
    Empty
    Value(ValueType)
    MultiValue(Array[ValueType])
    InlineType(Array[ValueType], Array[ValueType])
    TypeIndex(Int)
    } derive(Eq,
    Debug
    )

    Block type

    BlockType::equal

    fn BlockType::equal(BlockType, BlockType) -> Bool

    BlockType::not_equal

    fn BlockType::not_equal(x : BlockType, y : BlockType) -> Bool

    CatchHandler

    pub(all) enum CatchHandler {
    Catch(Int, Int)
    CatchRef(Int, Int)
    CatchAll(Int)
    CatchAllRef(Int)
    } derive(Eq,
    Debug
    )

    Catch handler for try_table instruction

    CatchHandler::equal

    CatchHandler::not_equal

    fn CatchHandler::not_equal(x : CatchHandler, y : CatchHandler) -> Bool

    CompositeType

    pub(all) enum CompositeType {
    Func(FuncType)
    Struct(StructType)
    Array(ArrayType)
    } derive(Eq,
    Debug
    )

    Composite type (func, struct, or array)

    CompositeType::equal

    CompositeType::not_equal

    fn CompositeType::not_equal(x : CompositeType, y : CompositeType) -> Bool

    CompositeType::output

    fn CompositeType::output(self : CompositeType, logger : &Logger) -> Unit

    CompositeType::to_string

    fn CompositeType::to_string(self : CompositeType) -> String

    Data

    pub(all) struct Data {
    memory_idx : Int
    offset : Array[Instruction]
    init : Bytes
    } derive(Eq,
    Debug
    )

    Data segment

    Data::equal

    fn Data::equal(Data, Data) -> Bool

    Data::not_equal

    fn Data::not_equal(x : Data, y : Data) -> Bool

    Data::to_repr

    ElemMode

    pub(all) enum ElemMode {
    Active(Int, Array[Instruction])
    Passive
    Declarative
    } derive(Eq,
    Debug
    )

    Element segment mode

    ElemMode::equal

    fn ElemMode::equal(ElemMode, ElemMode) -> Bool

    ElemMode::not_equal

    fn ElemMode::not_equal(x : ElemMode, y : ElemMode) -> Bool

    ElemMode::to_repr

    Element

    pub(all) struct Element {
    mode : ElemMode
    type_ : ValueType
    init : Array[Array[Instruction]]
    } derive(Eq,
    Debug
    )

    Element segment

    Element::equal

    fn Element::equal(Element, Element) -> Bool

    Element::not_equal

    fn Element::not_equal(x : Element, y : Element) -> Bool

    Element::to_repr

    Export

    pub(all) struct Export {
    name : String
    desc : ExportDesc
    } derive(Eq,
    Debug
    )

    Export entry

    Export::equal

    fn Export::equal(Export, Export) -> Bool

    Export::not_equal

    fn Export::not_equal(x : Export, y : Export) -> Bool

    Export::to_repr

    ExportDesc

    pub(all) enum ExportDesc {
    Func(Int)
    Table(Int)
    Memory(Int)
    Global(Int)
    Tag(Int)
    } derive(Eq,
    Debug
    )

    Export descriptor

    ExportDesc::equal

    fn ExportDesc::equal(ExportDesc, ExportDesc) -> Bool

    ExportDesc::not_equal

    fn ExportDesc::not_equal(x : ExportDesc, y : ExportDesc) -> Bool

    FieldType

    pub(all) struct FieldType {
    storage_type : StorageType
    mutable : Bool
    } derive(Eq,
    Debug
    )

    Field type with mutability

    FieldType::equal

    fn FieldType::equal(FieldType, FieldType) -> Bool

    FieldType::not_equal

    fn FieldType::not_equal(x : FieldType, y : FieldType) -> Bool

    FuncType

    pub(all) struct FuncType {
    params : Array[ValueType]
    results : Array[ValueType]
    } derive(Eq,
    Debug
    )

    Function type
    impl Show for FuncType

    FuncType::equal

    fn FuncType::equal(FuncType, FuncType) -> Bool

    FuncType::not_equal

    fn FuncType::not_equal(x : FuncType, y : FuncType) -> Bool

    FuncType::output

    fn FuncType::output(self : FuncType, logger : &Logger) -> Unit

    FuncType::structural_hash

    fn FuncType::structural_hash(self : FuncType) -> Int

    Compute a hash for structural type equivalence. Two FuncTypes with the same params and results will have the same hash.

    FuncType::structurally_equal

    fn FuncType::structurally_equal(self : FuncType, other : FuncType, self_idx : Int, other_idx : Int) -> Bool

    Check if two FuncTypes are structurally equivalent. This handles recursive types by comparing the structure rather than indices. type1_idx and type2_idx are the indices of the types being compared.

    FuncType::to_repr

    FuncType::to_string

    fn FuncType::to_string(self : FuncType) -> String

    FunctionCode

    pub(all) struct FunctionCode {
    locals : Array[ValueType]
    body : Array[Instruction]
    } derive(Eq,
    Debug
    )

    Function code

    FunctionCode::equal

    FunctionCode::not_equal

    fn FunctionCode::not_equal(x : FunctionCode, y : FunctionCode) -> Bool

    FunctionCode::output

    fn FunctionCode::output(self : FunctionCode, logger : &Logger) -> Unit

    FunctionCode::to_string

    fn FunctionCode::to_string(self : FunctionCode) -> String

    Global

    pub(all) struct Global {
    type_ : GlobalType
    init : Array[Instruction]
    } derive(Eq,
    Debug
    )

    Global definition

    Global::equal

    fn Global::equal(Global, Global) -> Bool

    Global::not_equal

    fn Global::not_equal(x : Global, y : Global) -> Bool

    Global::to_repr

    GlobalType

    pub(all) struct GlobalType {
    value_type : ValueType
    mutable : Bool
    } derive(Eq,
    Debug
    )

    Global type
    impl Show for GlobalType

    GlobalType::equal

    fn GlobalType::equal(GlobalType, GlobalType) -> Bool

    GlobalType::not_equal

    fn GlobalType::not_equal(x : GlobalType, y : GlobalType) -> Bool

    GlobalType::output

    fn GlobalType::output(self : GlobalType, logger : &Logger) -> Unit

    GlobalType::to_string

    fn GlobalType::to_string(self : GlobalType) -> String

    Import

    pub(all) struct Import {
    mod_name : String
    name : String
    desc : ImportDesc
    } derive(Eq,
    Debug
    )

    Import entry

    Import::equal

    fn Import::equal(Import, Import) -> Bool

    Import::not_equal

    fn Import::not_equal(x : Import, y : Import) -> Bool

    Import::to_repr

    ImportDesc

    pub(all) enum ImportDesc {
    Func(Int)
    Table(TableType)
    Memory(MemoryType)
    Global(GlobalType)
    Tag(Int)
    } derive(Eq,
    Debug
    )

    Import descriptor

    ImportDesc::equal

    fn ImportDesc::equal(ImportDesc, ImportDesc) -> Bool

    ImportDesc::not_equal

    fn ImportDesc::not_equal(x : ImportDesc, y : ImportDesc) -> Bool

    Instruction

    pub(all) enum Instruction {
    Unreachable
    Nop
    Block(BlockType, Array[Instruction])
    Loop(BlockType, Array[Instruction])
    If(BlockType, Array[Instruction], Array[Instruction])
    Br(Int)
    BrIf(Int)
    BrTable(Array[Int], Int)
    Return
    Call(Int)
    CallIndirect(Int, Int)
    CallRef(Int)
    ReturnCall(Int)
    ReturnCallIndirect(Int, Int)
    ReturnCallRef(Int)
    Throw(Int)
    ThrowRef
    TryTable(BlockType, Array[CatchHandler], Array[Instruction])
    Drop
    Select
    SelectTyped(Array[ValueType])
    LocalGet(Int)
    LocalSet(Int)
    LocalTee(Int)
    GlobalGet(Int)
    GlobalSet(Int)
    TableGet(Int)
    TableSet(Int)
    TableSize(Int)
    TableGrow(Int)
    TableFill(Int)
    TableCopy(Int, Int)
    TableInit(Int, Int)
    I32Load(Int, Int, Int64)
    I64Load(Int, Int, Int64)
    F32Load(Int, Int, Int64)
    F64Load(Int, Int, Int64)
    I32Load8S(Int, Int, Int64)
    I32Load8U(Int, Int, Int64)
    I32Load16S(Int, Int, Int64)
    I32Load16U(Int, Int, Int64)
    I64Load8S(Int, Int, Int64)
    I64Load8U(Int, Int, Int64)
    I64Load16S(Int, Int, Int64)
    I64Load16U(Int, Int, Int64)
    I64Load32S(Int, Int, Int64)
    I64Load32U(Int, Int, Int64)
    I32Store(Int, Int, Int64)
    I64Store(Int, Int, Int64)
    F32Store(Int, Int, Int64)
    F64Store(Int, Int, Int64)
    I32Store8(Int, Int, Int64)
    I32Store16(Int, Int, Int64)
    I64Store8(Int, Int, Int64)
    I64Store16(Int, Int, Int64)
    I64Store32(Int, Int, Int64)
    MemorySize(Int)
    MemoryGrow(Int)
    MemoryInit(Int, Int)
    DataDrop(Int)
    MemoryCopy(Int, Int)
    MemoryFill(Int)
    ElemDrop(Int)
    Atomic(Int, Int, Int, Int64)
    RefNull(ValueType)
    RefIsNull
    RefFunc(Int)
    RefAsNonNull
    RefEqInstr
    BrOnNull(Int)
    BrOnNonNull(Int)
    I32Const(Int)
    I64Const(Int64)
    F32Const(Float)
    F64Const(Double)
    I32Eqz
    I32Eq
    I32Ne
    I32LtS
    I32LtU
    I32GtS
    I32GtU
    I32LeS
    I32LeU
    I32GeS
    I32GeU
    I32Clz
    I32Ctz
    I32Popcnt
    I32Add
    I32Sub
    I32Mul
    I32DivS
    I32DivU
    I32RemS
    I32RemU
    I32And
    I32Or
    I32Xor
    I32Shl
    I32ShrS
    I32ShrU
    I32Rotl
    I32Rotr
    I32Extend8S
    I32Extend16S
    I64Eqz
    I64Eq
    I64Ne
    I64LtS
    I64LtU
    I64GtS
    I64GtU
    I64LeS
    I64LeU
    I64GeS
    I64GeU
    I64Clz
    I64Ctz
    I64Popcnt
    I64Add
    I64Sub
    I64Mul
    I64MulWideS
    I64MulWideU
    I64DivS
    I64DivU
    I64RemS
    I64RemU
    I64And
    I64Or
    I64Xor
    I64Shl
    I64ShrS
    I64ShrU
    I64Rotl
    I64Rotr
    I64Extend8S
    I64Extend16S
    I64Extend32S
    F32Eq
    F32Ne
    F32Lt
    F32Gt
    F32Le
    F32Ge
    F32Abs
    F32Neg
    F32Ceil
    F32Floor
    F32Trunc
    F32Nearest
    F32Sqrt
    F32Add
    F32Sub
    F32Mul
    F32Div
    F32Min
    F32Max
    F32Copysign
    F64Eq
    F64Ne
    F64Lt
    F64Gt
    F64Le
    F64Ge
    F64Abs
    F64Neg
    F64Ceil
    F64Floor
    F64Trunc
    F64Nearest
    F64Sqrt
    F64Add
    F64Sub
    F64Mul
    F64Div
    F64Min
    F64Max
    F64Copysign
    I32WrapI64
    I32TruncF32S
    I32TruncF32U
    I32TruncF64S
    I32TruncF64U
    I64ExtendI32S
    I64ExtendI32U
    I64TruncF32S
    I64TruncF32U
    I64TruncF64S
    I64TruncF64U
    F32ConvertI32S
    F32ConvertI32U
    F32ConvertI64S
    F32ConvertI64U
    F32DemoteF64
    F64ConvertI32S
    F64ConvertI32U
    F64ConvertI64S
    F64ConvertI64U
    F64PromoteF32
    I32ReinterpretF32
    I64ReinterpretF64
    F32ReinterpretI32
    F64ReinterpretI64
    I32TruncSatF32S
    I32TruncSatF32U
    I32TruncSatF64S
    I32TruncSatF64U
    I64TruncSatF32S
    I64TruncSatF32U
    I64TruncSatF64S
    I64TruncSatF64U
    StructNew(Int)
    StructNewDefault(Int)
    StructGet(Int, Int)
    StructGetS(Int, Int)
    StructGetU(Int, Int)
    StructSet(Int, Int)
    ArrayNew(Int)
    ArrayNewDefault(Int)
    ArrayNewFixed(Int, Int)
    ArrayNewData(Int, Int)
    ArrayNewElem(Int, Int)
    ArrayGet(Int)
    ArrayGetS(Int)
    ArrayGetU(Int)
    ArraySet(Int)
    ArrayLen
    ArrayFill(Int)
    ArrayCopy(Int, Int)
    ArrayInitData(Int, Int)
    ArrayInitElem(Int, Int)
    RefTest(ValueType)
    RefTestNull(ValueType)
    RefCast(ValueType)
    RefCastNull(ValueType)
    BrOnCast(Int, ValueType, ValueType)
    BrOnCastFail(Int, ValueType, ValueType)
    RefI31
    I31GetS
    I31GetU
    AnyConvertExtern
    ExternConvertAny
    V128Const(Bytes)
    V128Load(Int, Int, Int64)
    V128Load8x8S(Int, Int, Int64)
    V128Load8x8U(Int, Int, Int64)
    V128Load16x4S(Int, Int, Int64)
    V128Load16x4U(Int, Int, Int64)
    V128Load32x2S(Int, Int, Int64)
    V128Load32x2U(Int, Int, Int64)
    V128Load8Splat(Int, Int, Int64)
    V128Load16Splat(Int, Int, Int64)
    V128Load32Splat(Int, Int, Int64)
    V128Load64Splat(Int, Int, Int64)
    V128Load32Zero(Int, Int, Int64)
    V128Load64Zero(Int, Int, Int64)
    V128Store(Int, Int, Int64)
    V128Load8Lane(Int, Int, Int64, Int)
    V128Load16Lane(Int, Int, Int64, Int)
    V128Load32Lane(Int, Int, Int64, Int)
    V128Load64Lane(Int, Int, Int64, Int)
    V128Store8Lane(Int, Int, Int64, Int)
    V128Store16Lane(Int, Int, Int64, Int)
    V128Store32Lane(Int, Int, Int64, Int)
    V128Store64Lane(Int, Int, Int64, Int)
    I8x16Shuffle(FixedArray[Int])
    I8x16Swizzle
    I8x16Splat
    I16x8Splat
    I32x4Splat
    I64x2Splat
    F32x4Splat
    F64x2Splat
    I8x16ExtractLaneS(Int)
    I8x16ExtractLaneU(Int)
    I16x8ExtractLaneS(Int)
    I16x8ExtractLaneU(Int)
    I32x4ExtractLane(Int)
    I64x2ExtractLane(Int)
    F32x4ExtractLane(Int)
    F64x2ExtractLane(Int)
    I8x16ReplaceLane(Int)
    I16x8ReplaceLane(Int)
    I32x4ReplaceLane(Int)
    I64x2ReplaceLane(Int)
    F32x4ReplaceLane(Int)
    F64x2ReplaceLane(Int)
    I8x16Eq
    I8x16Ne
    I8x16LtS
    I8x16LtU
    I8x16GtS
    I8x16GtU
    I8x16LeS
    I8x16LeU
    I8x16GeS
    I8x16GeU
    I16x8Eq
    I16x8Ne
    I16x8LtS
    I16x8LtU
    I16x8GtS
    I16x8GtU
    I16x8LeS
    I16x8LeU
    I16x8GeS
    I16x8GeU
    I32x4Eq
    I32x4Ne
    I32x4LtS
    I32x4LtU
    I32x4GtS
    I32x4GtU
    I32x4LeS
    I32x4LeU
    I32x4GeS
    I32x4GeU
    I64x2Eq
    I64x2Ne
    I64x2LtS
    I64x2GtS
    I64x2LeS
    I64x2GeS
    F32x4Eq
    F32x4Ne
    F32x4Lt
    F32x4Gt
    F32x4Le
    F32x4Ge
    F64x2Eq
    F64x2Ne
    F64x2Lt
    F64x2Gt
    F64x2Le
    F64x2Ge
    V128Not
    V128And
    V128AndNot
    V128Or
    V128Xor
    V128Bitselect
    V128AnyTrue
    I8x16Abs
    I8x16Neg
    I8x16Popcnt
    I8x16AllTrue
    I8x16Bitmask
    I8x16NarrowI16x8S
    I8x16NarrowI16x8U
    I8x16Shl
    I8x16ShrS
    I8x16ShrU
    I8x16Add
    I8x16AddSatS
    I8x16AddSatU
    I8x16Sub
    I8x16SubSatS
    I8x16SubSatU
    I8x16MinS
    I8x16MinU
    I8x16MaxS
    I8x16MaxU
    I8x16AvgrU
    I16x8ExtAddPairwiseI8x16S
    I16x8ExtAddPairwiseI8x16U
    I16x8Abs
    I16x8Neg
    I16x8Q15MulrSatS
    I16x8AllTrue
    I16x8Bitmask
    I16x8NarrowI32x4S
    I16x8NarrowI32x4U
    I16x8ExtendLowI8x16S
    I16x8ExtendHighI8x16S
    I16x8ExtendLowI8x16U
    I16x8ExtendHighI8x16U
    I16x8Shl
    I16x8ShrS
    I16x8ShrU
    I16x8Add
    I16x8AddSatS
    I16x8AddSatU
    I16x8Sub
    I16x8SubSatS
    I16x8SubSatU
    I16x8Mul
    I16x8MinS
    I16x8MinU
    I16x8MaxS
    I16x8MaxU
    I16x8AvgrU
    I16x8ExtMulLowI8x16S
    I16x8ExtMulHighI8x16S
    I16x8ExtMulLowI8x16U
    I16x8ExtMulHighI8x16U
    I32x4ExtAddPairwiseI16x8S
    I32x4ExtAddPairwiseI16x8U
    I32x4Abs
    I32x4Neg
    I32x4AllTrue
    I32x4Bitmask
    I32x4ExtendLowI16x8S
    I32x4ExtendHighI16x8S
    I32x4ExtendLowI16x8U
    I32x4ExtendHighI16x8U
    I32x4Shl
    I32x4ShrS
    I32x4ShrU
    I32x4Add
    I32x4Sub
    I32x4Mul
    I32x4MinS
    I32x4MinU
    I32x4MaxS
    I32x4MaxU
    I32x4DotI16x8S
    I32x4ExtMulLowI16x8S
    I32x4ExtMulHighI16x8S
    I32x4ExtMulLowI16x8U
    I32x4ExtMulHighI16x8U
    I64x2Abs
    I64x2Neg
    I64x2AllTrue
    I64x2Bitmask
    I64x2ExtendLowI32x4S
    I64x2ExtendHighI32x4S
    I64x2ExtendLowI32x4U
    I64x2ExtendHighI32x4U
    I64x2Shl
    I64x2ShrS
    I64x2ShrU
    I64x2Add
    I64x2Sub
    I64x2Mul
    I64x2ExtMulLowI32x4S
    I64x2ExtMulHighI32x4S
    I64x2ExtMulLowI32x4U
    I64x2ExtMulHighI32x4U
    F32x4Ceil
    F32x4Floor
    F32x4Trunc
    F32x4Nearest
    F32x4Abs
    F32x4Neg
    F32x4Sqrt
    F32x4Add
    F32x4Sub
    F32x4Mul
    F32x4Div
    F32x4Min
    F32x4Max
    F32x4Pmin
    F32x4Pmax
    F64x2Ceil
    F64x2Floor
    F64x2Trunc
    F64x2Nearest
    F64x2Abs
    F64x2Neg
    F64x2Sqrt
    F64x2Add
    F64x2Sub
    F64x2Mul
    F64x2Div
    F64x2Min
    F64x2Max
    F64x2Pmin
    F64x2Pmax
    I32x4TruncSatF32x4S
    I32x4TruncSatF32x4U
    F32x4ConvertI32x4S
    F32x4ConvertI32x4U
    I32x4TruncSatF64x2SZero
    I32x4TruncSatF64x2UZero
    F64x2ConvertLowI32x4S
    F64x2ConvertLowI32x4U
    F32x4DemoteF64x2Zero
    F64x2PromoteLowF32x4
    I8x16RelaxedSwizzle
    I32x4RelaxedTruncF32x4S
    I32x4RelaxedTruncF32x4U
    I32x4RelaxedTruncF64x2SZero
    I32x4RelaxedTruncF64x2UZero
    F32x4RelaxedMadd
    F32x4RelaxedNmadd
    F64x2RelaxedMadd
    F64x2RelaxedNmadd
    I8x16RelaxedLaneselect
    I16x8RelaxedLaneselect
    I32x4RelaxedLaneselect
    I64x2RelaxedLaneselect
    F32x4RelaxedMin
    F32x4RelaxedMax
    F64x2RelaxedMin
    F64x2RelaxedMax
    I16x8RelaxedQ15mulrS
    I16x8RelaxedDotI8x16I7x16S
    I32x4RelaxedDotI8x16I7x16AddS
    } derive(Eq,
    Debug
    )

    WebAssembly instructions
    impl Show for Instruction

    Instruction::equal

    fn Instruction::equal(Instruction, Instruction) -> Bool

    Instruction::not_equal

    fn Instruction::not_equal(x : Instruction, y : Instruction) -> Bool

    Instruction::output

    fn Instruction::output(self : Instruction, logger : &Logger) -> Unit

    Instruction::to_string

    fn Instruction::to_string(self : Instruction) -> String

    Limits

    pub(all) struct Limits {
    min : Int64
    max : Int64?
    } derive(Eq,
    Debug
    )

    Limits for memory and tables Uses Int64 to support memory64 proposal (limits up to 2^48 pages)

    Limits::equal

    fn Limits::equal(Limits, Limits) -> Bool

    Limits::not_equal

    fn Limits::not_equal(x : Limits, y : Limits) -> Bool

    Limits::to_repr

    MemoryType

    pub(all) struct MemoryType {
    limits : Limits
    is_memory64 : Bool
    page_size_log2 : Int
    } derive(Eq,
    Debug
    )

    Memory type
    impl Show for MemoryType

    MemoryType::addr_type

    fn MemoryType::addr_type(self : MemoryType) -> ValueType

    Get the address type for this memory (I32 for 32-bit, I64 for 64-bit)

    MemoryType::equal

    fn MemoryType::equal(MemoryType, MemoryType) -> Bool

    MemoryType::not_equal

    fn MemoryType::not_equal(x : MemoryType, y : MemoryType) -> Bool

    MemoryType::output

    fn MemoryType::output(self : MemoryType, logger : &Logger) -> Unit

    MemoryType::to_string

    fn MemoryType::to_string(self : MemoryType) -> String

    Module

    pub(all) struct Module {
    types : Array[SubType]
    type_rec_groups : Array[Int]
    imports : Array[Import]
    funcs : Array[Int]
    tables : Array[Table]
    memories : Array[MemoryType]
    globals : Array[Global]
    exports : Array[Export]
    start : Int?
    elems : Array[Element]
    codes : Array[FunctionCode]
    datas : Array[Data]
    tags : Array[TagType]
    func_names : Map[Int, String]
    } derive(
    Debug
    )

    WebAssembly module
    impl Show for Module

    Module::Module

    fn Module::Module() -> Module

    Create an empty module

    Module::array_type_at

    fn Module::array_type_at(self : Module, idx : Int) -> ArrayType?

    The array type at idx, or None if the index is out of range or names a type of another kind.

    Module::empty

    fn Module::empty() -> Module

    Create an empty module with all fields set to empty arrays/None.

    Module::func_type_at

    fn Module::func_type_at(self : Module, idx : Int) -> FuncType?

    The function type at idx, or None if the index is out of range or names a type of another kind.

    Module::is_array_type

    fn Module::is_array_type(self : Module, idx : Int) -> Bool

    Check if the type at the given index is an array type.

    Module::is_func_type

    fn Module::is_func_type(self : Module, idx : Int) -> Bool

    Check if the type at the given index is a function type.

    Module::is_struct_type

    fn Module::is_struct_type(self : Module, idx : Int) -> Bool

    Check if the type at the given index is a struct type.

    Module::output

    fn Module::output(self : Module, logger : &Logger) -> Unit

    Module::simple

    fn Module::simple(params : Array[ValueType], results : Array[ValueType], body : Array[Instruction], export_name : String) -> Module

    Create a simple module with one function. This is useful for tests that need a minimal valid module.

    Module::struct_type_at

    fn Module::struct_type_at(self : Module, idx : Int) -> StructType?

    The struct type at idx, or None if the index is out of range or names a type of another kind.

    Module::to_repr

    Module::to_string

    fn Module::to_string(self : Module) -> String

    Module::validated_array_type_at

    fn Module::validated_array_type_at(self : Module, idx : Int) -> ArrayType

    The array type at idx in a module that has passed validation.

    Module::validated_func_type_at

    fn Module::validated_func_type_at(self : Module, idx : Int) -> FuncType

    The function type at idx in a module that has passed validation.

    Module::validated_struct_type_at

    fn Module::validated_struct_type_at(self : Module, idx : Int) -> StructType

    The struct type at idx in a module that has passed validation.

    PackedType

    pub(all) enum PackedType {
    I8
    I16
    } derive(Eq,
    Debug
    )

    Packed storage types for struct/array fields

    PackedType::equal

    fn PackedType::equal(PackedType, PackedType) -> Bool

    PackedType::not_equal

    fn PackedType::not_equal(x : PackedType, y : PackedType) -> Bool

    StorageType

    pub(all) enum StorageType {
    Val(ValueType)
    Packed(PackedType)
    } derive(Eq,
    Debug
    )

    Storage type for struct/array fields
    impl Show for StorageType

    StorageType::equal

    fn StorageType::equal(StorageType, StorageType) -> Bool

    StorageType::not_equal

    fn StorageType::not_equal(x : StorageType, y : StorageType) -> Bool

    StorageType::output

    fn StorageType::output(self : StorageType, logger : &Logger) -> Unit

    StorageType::to_string

    fn StorageType::to_string(self : StorageType) -> String

    StructType

    pub(all) struct StructType {
    fields : Array[FieldType]
    } derive(Eq,
    Debug
    )

    Struct type definition

    StructType::equal

    fn StructType::equal(StructType, StructType) -> Bool

    StructType::not_equal

    fn StructType::not_equal(x : StructType, y : StructType) -> Bool

    SubType

    pub(all) struct SubType {
    final_ : Bool
    supertypes : Array[Int]
    composite : CompositeType
    } derive(Eq,
    Debug
    )

    Subtype definition with optional supertype
    impl Show for SubType

    SubType::equal

    fn SubType::equal(SubType, SubType) -> Bool

    SubType::from_func

    fn SubType::from_func(func_type : FuncType) -> SubType

    Create a subtype from a function type

    SubType::func

    fn SubType::func(params : Array[ValueType], results : Array[ValueType]) -> SubType

    Create a subtype from params and results (convenience function)

    SubType::not_equal

    fn SubType::not_equal(x : SubType, y : SubType) -> Bool

    SubType::output

    fn SubType::output(self : SubType, logger : &Logger) -> Unit

    SubType::simple

    fn SubType::simple(composite : CompositeType) -> SubType

    Create a simple subtype without inheritance

    SubType::to_repr

    SubType::to_string

    fn SubType::to_string(self : SubType) -> String

    SubtypingContext

    pub struct SubtypingContext {
    types1 : Array[SubType]
    types2 : Array[SubType]
    rec_groups1 : Array[Int]
    rec_groups2 : Array[Int]
    canonical1 : Array[Int]
    canonical2 : Array[Int]
    cross_module : Bool
    visited : Map[(Int, Int), Bool]
    }

    Context for subtyping checks. Can be used for same-module or cross-module comparisons.

    SubtypingContext::cross_module

    fn SubtypingContext::cross_module(types1 : Array[SubType], types2 : Array[SubType], rec_groups1? : Array[Int], rec_groups2? : Array[Int], canonical1? : Array[Int], canonical2? : Array[Int]) -> SubtypingContext

    Create a context for cross-module subtyping (e.g., import validation).

    SubtypingContext::is_subtype

    fn SubtypingContext::is_subtype(self : SubtypingContext, idx1 : Int, idx2 : Int) -> Bool

    Check if type at idx1 is a subtype of type at idx2. This is the main entry point for runtime type subtyping. For WebAssembly GC isorecursive types, subtyping is based on:
    1. Type equality (via canonical indices)
    2. Declared supertype chain Structural subtyping is NOT considered at runtime (only for validation).

    SubtypingContext::same_module

    fn SubtypingContext::same_module(types : Array[SubType], rec_groups? : Array[Int], canonical? : Array[Int]) -> SubtypingContext

    Create a context for same-module subtyping.

    SubtypingContext::validate_declared_subtype

    fn SubtypingContext::validate_declared_subtype(self : SubtypingContext, sub_idx : Int, super_idx : Int) -> Bool

    Validate that a declared subtype relationship is structurally valid. This should be called during validation to ensure that when a type declares a supertype, the subtype's structure is compatible.

    SubtypingContext::value_type_subtype

    fn SubtypingContext::value_type_subtype(self : SubtypingContext, v1 : ValueType, v2 : ValueType, _idx1? : Int, _idx2? : Int) -> Bool

    Value type subtyping including abstract heap type hierarchy.

    Table

    pub(all) struct Table {
    type_ : TableType
    init : Array[Instruction]?
    } derive(Eq,
    Debug
    )

    Table definition with optional init expression

    Table::equal

    fn Table::equal(Table, Table) -> Bool

    Table::not_equal

    fn Table::not_equal(x : Table, y : Table) -> Bool

    Table::to_repr

    TableType

    pub(all) struct TableType {
    elem_type : ValueType
    limits : Limits
    is_table64 : Bool
    } derive(Eq,
    Debug
    )

    Table type
    impl Show for TableType

    TableType::equal

    fn TableType::equal(TableType, TableType) -> Bool

    TableType::not_equal

    fn TableType::not_equal(x : TableType, y : TableType) -> Bool

    TableType::output

    fn TableType::output(self : TableType, logger : &Logger) -> Unit

    TableType::to_string

    fn TableType::to_string(self : TableType) -> String

    TagType

    pub(all) struct TagType {
    type_idx : Int
    } derive(Eq,
    Debug
    )

    Tag type (for exception handling) Tags define the signature of exceptions - they can only have parameters, not results

    TagType::equal

    fn TagType::equal(TagType, TagType) -> Bool

    TagType::not_equal

    fn TagType::not_equal(x : TagType, y : TagType) -> Bool

    TagType::to_repr

    TypeEquivalenceContext

    type TypeEquivalenceContext

    Context for type equivalence checking. Now uses SubType to properly handle func, struct, and array types.

    TypeEquivalenceContext::cross_module

    fn TypeEquivalenceContext::cross_module(types1 : Array[SubType], types2 : Array[SubType], rec_groups1? : Array[Int], rec_groups2? : Array[Int]) -> TypeEquivalenceContext

    Create a context for cross-module type comparison.

    TypeEquivalenceContext::same_module

    fn TypeEquivalenceContext::same_module(types : Array[SubType], type_rec_groups? : Array[Int]) -> TypeEquivalenceContext

    Create a context for same-module type comparison.

    TypeEquivalenceContext::types_equivalent

    fn TypeEquivalenceContext::types_equivalent(self : TypeEquivalenceContext, idx1 : Int, idx2 : Int) -> Bool

    Check if two types at given indices are equivalent. This is the main entry point for type equivalence checking. For isorecursive typing, types are equivalent iff they are in pairwise-equivalent rec groups at the same position.

    Value

    pub(all) enum Value {
    I32(Int)
    I64(Int64)
    F32(Float)
    F64(Double)
    V128(Bytes)
    FuncRef(Int)
    ExternRef(Int)
    ExnRef(Int)
    StructRef(Int)
    ArrayRef(Int)
    I31(Int)
    Null
    } derive(Eq,
    Debug
    )

    Runtime values
    impl Show for Value

    Value::equal

    fn Value::equal(Value, Value) -> Bool

    Value::not_equal

    fn Value::not_equal(x : Value, y : Value) -> Bool

    Value::output

    fn Value::output(self : Value, logger : &Logger) -> Unit

    Value::to_repr

    Value::to_string

    fn Value::to_string(self : Value) -> String

    ValueType

    pub(all) enum ValueType {
    I32
    I64
    F32
    F64
    V128
    FuncRef
    ExternRef
    RefFunc
    RefExtern
    RefFuncTyped(Int)
    RefNullFuncTyped(Int)
    AnyRef
    ExnRef
    StructRef
    ArrayRef
    RefStruct(Int)
    RefNullStruct(Int)
    RefArray(Int)
    RefNullArray(Int)
    RefAny
    RefEq
    RefNullEq
    RefI31
    RefNullI31
    RefStructAbs
    RefArrayAbs
    RefNone
    NullRef
    NullFuncRef
    NullExnRef
    NullExternRef
    } derive(Eq,
    Debug
    )

    WebAssembly value types
    impl Show for ValueType

    ValueType::equal

    fn ValueType::equal(ValueType, ValueType) -> Bool

    ValueType::is_nullable

    fn ValueType::is_nullable(self : ValueType) -> Bool

    Check if a reference type is nullable

    ValueType::not_equal

    fn ValueType::not_equal(x : ValueType, y : ValueType) -> Bool

    ValueType::output

    fn ValueType::output(self : ValueType, logger : &Logger) -> Unit

    ValueType::to_string

    fn ValueType::to_string(self : ValueType) -> String

    ASCII_DEL

    let ASCII_DEL : Int

    ASCII DEL (127), the first non-printable codepoint after printable ASCII.

    F32_CANONICAL_NAN_BITS

    let F32_CANONICAL_NAN_BITS : Int

    Canonical f32 NaN bit-pattern used by WebAssembly tests.

    F32_EXP_BIAS

    let F32_EXP_BIAS : Int

    IEEE-754 f32 exponent bias.

    F32_EXP_INF_NAN

    let F32_EXP_INF_NAN : Int

    IEEE-754 f32 all-ones exponent field (Inf/NaN).

    I32_MAX

    let I32_MAX : Int

    Signed i32 maximum value.

    I32_MAX_F32

    let I32_MAX_F32 : Float

    Signed i32 maximum value as f32.

    I32_MAX_F64

    let I32_MAX_F64 : Double

    Signed i32 maximum value as f64.

    I32_MIN

    let I32_MIN : Int

    Signed i32 minimum value.

    I32_MIN_F32

    let I32_MIN_F32 : Float

    Signed i32 minimum value as f32.

    I32_MIN_F64

    let I32_MIN_F64 : Double

    Signed i32 minimum value as f64.

    I8_MAX

    let I8_MAX : Int

    Signed i8 max (0x7F).

    ONE_MIB_BYTES

    let ONE_MIB_BYTES : Int

    One mebibyte in bytes.

    SIXTEEN_MIB_BYTES

    let SIXTEEN_MIB_BYTES : Int64

    Sixteen mebibytes in bytes.

    U32_MAX

    let U32_MAX : UInt

    Unsigned i32 maximum value.

    U32_MAX_F32

    let U32_MAX_F32 : Float

    Unsigned i32 maximum value as f32.

    U32_MAX_F64

    let U32_MAX_F64 : Double

    Unsigned i32 maximum value as f64.

    U32_MODULUS_F32

    let U32_MODULUS_F32 : Float

    Unsigned i32 modulus (2^32) as f32.

    U32_MODULUS_F64

    let U32_MODULUS_F64 : Double

    Unsigned i32 modulus (2^32) as f64.

    U32_MODULUS_I64

    let U32_MODULUS_I64 : Int64

    Unsigned i32 modulus (2^32) as i64.

    U8_MAX

    let U8_MAX : Int

    Unsigned i8 max (0xFF).

    WASM_PAGE_SIZE_BYTES

    let WASM_PAGE_SIZE_BYTES : Int64

    WebAssembly page size in bytes.

    bytes_to_int64_le

    fn bytes_to_int64_le(bytes : Bytes, offset : Int) -> Int64

    Decode 8 bytes at the given offset as a little-endian Int64 bit pattern.

    compact_show_repr

    fn compact_show_repr(text : String) -> String

    compute_canonical_type_indices

    fn compute_canonical_type_indices(types : Array[SubType], type_rec_groups? : Array[Int]) -> Array[Int]

    Compute canonical type indices for a module's types. Structurally equivalent types (in equivalent rec groups) will be assigned the same canonical index. For isorecursive typing, entire rec groups must be pairwise equivalent.

    func_types_equal

    fn func_types_equal(t1 : FuncType, t2 : FuncType) -> Bool

    Compare two function types for simple structural equality. This is for direct type comparison without type indices (e.g., host functions). Note: This does NOT handle typed function references properly - use TypeEquivalenceContext for full recursive type comparison.

    func_types_to_subtypes

    fn func_types_to_subtypes(func_types : Array[FuncType]) -> Array[SubType]

    Convert an array of FuncType to an array of SubType

    get_rec_group_info

    fn get_rec_group_info(rec_groups : Array[Int], type_idx : Int) -> (Int, Int)

    Get rec group info (position, size) for a type at given index. Returns (position_in_group, group_size) tuple.

    int64_pair_to_v128_le

    fn int64_pair_to_v128_le(low : Int64, high : Int64) -> Bytes

    Encode a Wasm v128 lane pair as 16 little-endian bytes.

    int_to_hex

    fn int_to_hex(n : Int) -> String

    Convert an integer to a variable-length hex string (no leading zeros)

    to_hex_byte

    fn to_hex_byte(b : Int) -> String

    Convert a single byte (0-255) to a 2-character hex string

    to_hex_u16

    fn to_hex_u16(n : Int) -> String

    Convert a 16-bit value to a 4-character hex string