Struct wasm_runtime_layer::Global
source · pub struct Global { /* private fields */ }
Expand description
A Wasm global variable reference.
Implementations§
source§impl Global
impl Global
sourcepub fn new<C: AsContextMut>(ctx: C, initial_value: Value, mutable: bool) -> Self
pub fn new<C: AsContextMut>(ctx: C, initial_value: Value, mutable: bool) -> Self
Creates a new global variable to the store.
sourcepub fn ty<C: AsContext>(&self, ctx: C) -> GlobalType
pub fn ty<C: AsContext>(&self, ctx: C) -> GlobalType
Returns the GlobalType
of the global variable.
sourcepub fn get<C: AsContextMut>(&self, ctx: C) -> Value
pub fn get<C: AsContextMut>(&self, ctx: C) -> Value
Returns the current value of the global variable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Global
impl !RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl !UnwindSafe for Global
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more