gl_wasm/wasm/def

Types

pub type CompositeType {
  Func(params: List(ValueType), result: List(ValueType))
  Array(item_type: FieldType)
  Struct(field_types: List(FieldType))
}

Constructors

pub opaque type Context
pub type DefType {
  DefType(rec: Int, proj: Int)
}

Constructors

  • DefType(rec: Int, proj: Int)
pub type FieldType {
  PackedType(mutable: Mutability, packed_type: PackedType)
  ValueType(mutable: Mutability, value_type: ValueType)
}

Constructors

pub type HeapType {
  Any
  Eq
  I31
  AbstractStruct
  AbstractArray
  None
  AbstractFunc
  NoFunc
  Extern
  NoExtern
  HeapBottom
  Def(def: DefType)
}

Constructors

  • Any
  • Eq
  • I31
  • AbstractStruct
  • AbstractArray
  • None
  • AbstractFunc
  • NoFunc
  • Extern
  • NoExtern
  • HeapBottom
  • Def(def: DefType)
pub type Mutability {
  Mutable
  Immutable
}

Constructors

  • Mutable
  • Immutable
pub type PackedType {
  I8
  I16
}

Constructors

  • I8
  • I16
pub type RefType {
  NonNull(heap: HeapType)
  Nullable(heap: HeapType)
}

Constructors

pub type SubType {
  SubOpen(super_types: List(DefType), definition: CompositeType)
  SubFinal(super_types: List(DefType), definition: CompositeType)
}

Constructors

pub type ValueType {
  I32
  I64
  F32
  F64
  V128
  Ref(ref: RefType)
  ValueBottom
}

Constructors

  • I32
  • I64
  • F32
  • F64
  • V128
  • Ref(ref: RefType)
  • ValueBottom

Values

pub fn add_rec_group(
  ctx: Context,
  rec: List(SubType),
) -> Result(Context, Nil)
pub fn get_def_type(
  ctx: Context,
  idx: Int,
) -> Result(DefType, Nil)

Get the defined type corresponding to a nominal type.

pub fn new_context() -> Context
pub fn unroll(ctx: Context, def: DefType) -> Result(SubType, Nil)

Unroll a defined type.

✨ Search Document