[][src]Struct walrus::ModuleGlobals

pub struct ModuleGlobals { /* fields omitted */ }

The set of globals in each function in this module.

Implementations

impl ModuleGlobals[src]

pub fn add_import(
    &mut self,
    ty: ValType,
    mutable: bool,
    import_id: ImportId
) -> GlobalId
[src]

Adds a new imported global to this list.

pub fn add_local(
    &mut self,
    ty: ValType,
    mutable: bool,
    init: InitExpr
) -> GlobalId
[src]

Construct a new global, that does not originate from any of the input wasm globals.

pub fn get(&self, id: GlobalId) -> &Global[src]

Gets a reference to a memory given its id

pub fn get_mut(&mut self, id: GlobalId) -> &mut Global[src]

Gets a reference to a memory given its id

pub fn delete(&mut self, id: GlobalId)[src]

Removes a global from this module.

It is up to you to ensure that any potential references to the deleted global are also removed, eg get_global expressions.

pub fn iter(&self) -> impl Iterator<Item = &Global>[src]

Get a shared reference to this module's globals.

Trait Implementations

impl Debug for ModuleGlobals[src]

impl Default for ModuleGlobals[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.