Show / Hide Table of Contents

Class Global

Represents a WebAssembly global value.

Inheritance
System.Object
Global
Namespace: Wasmtime
Assembly: Wasmtime.Dotnet.dll
Syntax
public class Global : object

Constructors

| Improve this Doc View Source

Global(Store, ValueKind, Nullable<Object>, Mutability)

Creates a new WebAssembly global value.

Declaration
public Global(Store store, ValueKind kind, object? initialValue, Mutability mutability)
Parameters
Type Name Description
Store store

The store to create the global in.

ValueKind kind

The kind of value stored in the global.

System.Nullable<System.Object> initialValue

The global's initial value.

Mutability mutability

The mutability of the global being created.

Properties

| Improve this Doc View Source

Kind

Gets the value kind of the global.

Declaration
public ValueKind Kind { get; }
Property Value
Type Description
ValueKind
| Improve this Doc View Source

Mutability

Gets the mutability of the global.

Declaration
public Mutability Mutability { get; }
Property Value
Type Description
Mutability

Methods

| Improve this Doc View Source

GetValue()

Gets the value of the global.

Declaration
public object? GetValue()
Returns
Type Description
System.Nullable<System.Object>

Returns the global's value.

| Improve this Doc View Source

SetValue(Nullable<Object>)

Sets the value of the global.

Declaration
public void SetValue(object? value)
Parameters
Type Name Description
System.Nullable<System.Object> value

The value to set.

| Improve this Doc View Source

Wrap<T>()

Wrap this global as a specific type, accessing through the wrapper avoids any boxing.

Declaration
public Global.Accessor<T> Wrap<T>()
Returns
Type Description
Global.Accessor<T>

An accessor for this global, or null if the type is incorrect

Type Parameters
Name Description
T

Type of this global

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX