Struct walrus::ModuleExports
source · pub struct ModuleExports { /* private fields */ }
Expand description
The set of exports in a module.
Implementations§
source§impl ModuleExports
impl ModuleExports
sourcepub fn get_mut(&mut self, id: ExportId) -> &mut Export
pub fn get_mut(&mut self, id: ExportId) -> &mut Export
Gets a reference to an export given its id
sourcepub fn iter(&self) -> impl Iterator<Item = &Export>
pub fn iter(&self) -> impl Iterator<Item = &Export>
Get a shared reference to this module’s exports.
sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Export>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Export>
Get a mutable reference to this module’s exports.
sourcepub fn add(&mut self, name: &str, item: impl Into<ExportItem>) -> ExportId
pub fn add(&mut self, name: &str, item: impl Into<ExportItem>) -> ExportId
Add a new export to this module
sourcepub fn get_exported_func(&self, f: FunctionId) -> Option<&Export>
pub fn get_exported_func(&self, f: FunctionId) -> Option<&Export>
Get a reference to a function export given its function id.
sourcepub fn get_func(&self, name: impl AsRef<str>) -> Result<FunctionId>
pub fn get_func(&self, name: impl AsRef<str>) -> Result<FunctionId>
Retrieve an exported function by export name
sourcepub fn get_exported_table(&self, t: TableId) -> Option<&Export>
pub fn get_exported_table(&self, t: TableId) -> Option<&Export>
Get a reference to a table export given its table id.
sourcepub fn get_exported_memory(&self, m: MemoryId) -> Option<&Export>
pub fn get_exported_memory(&self, m: MemoryId) -> Option<&Export>
Get a reference to a memory export given its export id.
sourcepub fn get_exported_global(&self, g: GlobalId) -> Option<&Export>
pub fn get_exported_global(&self, g: GlobalId) -> Option<&Export>
Get a reference to a global export given its global id.
Trait Implementations§
source§impl Debug for ModuleExports
impl Debug for ModuleExports
source§impl Default for ModuleExports
impl Default for ModuleExports
source§fn default() -> ModuleExports
fn default() -> ModuleExports
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModuleExports
impl RefUnwindSafe for ModuleExports
impl Send for ModuleExports
impl Sync for ModuleExports
impl Unpin for ModuleExports
impl UnwindSafe for ModuleExports
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