Struct wasmtime_types::Global
source · [−]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
sourceimpl Global
impl Global
sourcepub fn new(ty: GlobalType, initializer: GlobalInit) -> WasmResult<Global>
pub fn new(ty: GlobalType, initializer: GlobalInit) -> WasmResult<Global>
Creates a new Global
type from wasmparser’s representation.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Global
impl<'de> Deserialize<'de> for Global
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Global
impl Eq for Global
impl StructuralEq for Global
impl StructuralPartialEq for Global
Auto Trait Implementations
impl RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl UnwindSafe for Global
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more