[−][src]Struct walrus::ModuleFunctions
The set of functions within a module.
Methods
impl ModuleFunctions
[src]
pub fn new() -> ModuleFunctions
[src]
Construct a new, empty set of functions for a module.
pub fn add_import(&mut self, ty: TypeId, import: ImportId) -> FunctionId
[src]
Create a new externally defined, imported function.
pub fn add_local(&mut self, func: LocalFunction) -> FunctionId
[src]
Create a new internally defined function
pub fn get(&self, id: FunctionId) -> &Function
[src]
Gets a reference to a function given its id
pub fn get_mut(&mut self, id: FunctionId) -> &mut Function
[src]
Gets a reference to a function given its id
pub fn delete(&mut self, id: FunctionId)
[src]
Removes a function from this module.
It is up to you to ensure that any potential references to the deleted
function are also removed, eg call
expressions, exports, table
elements, etc.
pub fn iter(&self) -> impl Iterator<Item = &Function>
[src]
Get a shared reference to this module's functions.
pub fn par_iter(&self) -> impl ParallelIterator<Item = &Function>
[src]
Get a shared reference to this module's functions.
pub fn iter_local(&self) -> impl Iterator<Item = (FunctionId, &LocalFunction)>
[src]
Get an iterator of this module's local functions
pub fn par_iter_local(
&self
) -> impl ParallelIterator<Item = (FunctionId, &LocalFunction)>
[src]
&self
) -> impl ParallelIterator<Item = (FunctionId, &LocalFunction)>
Get a parallel iterator of this module's local functions
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Function>
[src]
Get a mutable reference to this module's functions.
pub fn par_iter_mut(&mut self) -> impl ParallelIterator<Item = &mut Function>
[src]
Get a mutable reference to this module's functions.
pub fn iter_local_mut(
&mut self
) -> impl Iterator<Item = (FunctionId, &mut LocalFunction)>
[src]
&mut self
) -> impl Iterator<Item = (FunctionId, &mut LocalFunction)>
Get an iterator of this module's local functions
pub fn par_iter_local_mut(
&mut self
) -> impl ParallelIterator<Item = (FunctionId, &mut LocalFunction)>
[src]
&mut self
) -> impl ParallelIterator<Item = (FunctionId, &mut LocalFunction)>
Get a parallel iterator of this module's local functions
Trait Implementations
impl Default for ModuleFunctions
[src]
fn default() -> ModuleFunctions
[src]
impl Debug for ModuleFunctions
[src]
Auto Trait Implementations
impl Send for ModuleFunctions
impl Sync for ModuleFunctions
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,