class Wasmer::GlobalType
- Wasmer::GlobalType
- Reference
- Object
Overview
GlobalType classifies global variables, which hold a value and can either be mutable or immutable. See Also: Specification: https://webassembly.github.io/spec/core/syntax/types.html#global-types
Included Modules
Defined in:
wasmer/global.crConstructors
-
.new(val_type : ValueType, mutability : GlobalMutability)
Instantiates a new
GlobalType
from aValueType
andGlobalMutability
Instance Method Summary
-
#mutability : GlobalMutability
Returns the
GlobalType
'sGlobalMutability
- #mutable?
-
#to_externtype : ExternType
Converts this
GlobalType
into anExternype
-
#value_type : ValueType
Returns the
GlobalType
'sValueType
Instance methods inherited from module Wasmer::WithExternType
to_externtype : ExternType
to_externtype
Constructor Detail
Instantiates a new GlobalType
from a ValueType
and GlobalMutability
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::Immutable)
Instance Method Detail
def mutability : GlobalMutability
#
Returns the GlobalType
's GlobalMutability
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::Immutable)
puts global_type.mutability # => const
def to_externtype : ExternType
#
Converts this GlobalType
into an Externype
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::Immutable)
extern_type = global_type.to_externtype
Returns the GlobalType
's ValueType
val_type = ValueType.new(Wasmer::I32)
global_type = GlobalType.new(val_type, Wasmer::Immutable)
puts global_type.value_type.kind # => i32