[][src]Struct walrus::ModuleImports

pub struct ModuleImports { /* fields omitted */ }

The set of imports in a module.

Methods

impl ModuleImports[src]

pub fn get(&self, id: ImportId) -> &Import[src]

Gets a reference to an import given its id

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

Gets a reference to an import given its id

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

Removes an import from this module.

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

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

Get a shared reference to this module's imports.

pub fn iter_mut(
    &mut self
) -> impl Iterator<Item = &mut Import>
[src]

Get mutable references to this module's imports.

pub fn add(
    &mut self,
    module: &str,
    name: &str,
    kind: impl Into<ImportKind>
) -> ImportId
[src]

Adds a new import to this module

Trait Implementations

impl Default for ModuleImports[src]

impl Debug for ModuleImports[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.