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,
shared: bool,
import_id: ImportId,
) -> GlobalId
pub fn add_import( &mut self, ty: ValType, mutable: bool, shared: bool, import_id: ImportId, ) -> GlobalId
Adds a new imported global to this list.
Sourcepub fn add_local(
&mut self,
ty: ValType,
mutable: bool,
shared: bool,
init: ConstExpr,
) -> GlobalId
pub fn add_local( &mut self, ty: ValType, mutable: bool, shared: bool, init: ConstExpr, ) -> 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 global 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 Freeze for ModuleGlobals
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