[][src]Struct walrus::ModuleImports

pub struct ModuleImports { /* fields omitted */ }

The set of imports in a module.

Implementations

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

pub fn find(&self, module: &str, name: &str) -> Option<ImportId>[src]

Get the import with the given module and name

Trait Implementations

impl Debug for ModuleImports[src]

impl Default for ModuleImports[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.