Struct walrus::ModuleGlobals
source · pub struct ModuleGlobals { /* private fields */ }
Expand description
The set of globals in each function in this module.
Implementations§
source§impl ModuleGlobals
impl ModuleGlobals
sourcepub fn add_import(
&mut self,
ty: ValType,
mutable: bool,
import_id: ImportId
) -> GlobalId
pub fn add_import( &mut self, ty: ValType, mutable: bool, import_id: ImportId ) -> GlobalId
Adds a new imported global to this list.
sourcepub fn add_local(
&mut self,
ty: ValType,
mutable: bool,
init: InitExpr
) -> GlobalId
pub fn add_local( &mut self, ty: ValType, mutable: bool, init: InitExpr ) -> GlobalId
Construct a new global, that does not originate from any of the input wasm globals.
sourcepub fn get_mut(&mut self, id: GlobalId) -> &mut Global
pub fn get_mut(&mut self, id: GlobalId) -> &mut Global
Gets a reference to a memory given its id
Trait Implementations§
source§impl Debug for ModuleGlobals
impl Debug for ModuleGlobals
source§impl Default for ModuleGlobals
impl Default for ModuleGlobals
source§fn default() -> ModuleGlobals
fn default() -> ModuleGlobals
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ModuleGlobals
impl Send for ModuleGlobals
impl Sync for ModuleGlobals
impl Unpin for ModuleGlobals
impl UnwindSafe for ModuleGlobals
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