pub struct Global {
    pub wasm_ty: WasmType,
    pub mutability: bool,
    pub initializer: GlobalInit,
}
Expand description

A WebAssembly global.

Note that we record both the original Wasm type and the Cranelift IR type used to represent it. This is because multiple different kinds of Wasm types might be represented with the same Cranelift IR type. For example, both a Wasm i64 and a funcref might be represented with a Cranelift i64 on 64-bit architectures, and when GC is not required for func refs.

Fields

wasm_ty: WasmType

The Wasm type of the value stored in the global.

mutability: bool

A flag indicating whether the value may change at runtime.

initializer: GlobalInit

The source of the initial value.

Implementations

Creates a new Global type from wasmparser’s representation.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.