Struct orca_wasm::ir::module::module_functions::Functions

source ·
pub struct Functions<'a> { /* private fields */ }
Expand description

Intermediate representation of all the functions in a module.

Implementations§

source§

impl<'a> Functions<'a>

source

pub fn new(functions: Vec<Function<'a>>) -> Self

Create a new functions section

source

pub fn get_fn_by_id(&self, function_id: FunctionID) -> Option<&Function<'a>>

Get a function by its FunctionID

source

pub fn is_empty(&self) -> bool

Checks if there are no functions

source

pub fn get_kind(&self, function_id: FunctionID) -> &FuncKind<'a>

Get kind of function

source

pub fn get_kind_mut(&mut self, function_id: FunctionID) -> &mut FuncKind<'a>

Get kind of function

source

pub fn get_name(&self, function_id: FunctionID) -> &Option<String>

Get the name of a function

source

pub fn is_local(&self, function_id: FunctionID) -> bool

Check if a function is a local

source

pub fn is_import(&self, function_id: FunctionID) -> bool

Check if a function is an import

source

pub fn get_type_id(&self, id: FunctionID) -> TypeID

Get the type ID of a function

source

pub fn is_deleted(&self, function_id: FunctionID) -> bool

Check if it’s deleted

source

pub fn get(&self, function_id: FunctionID) -> &Function<'a>

Get by ID

source

pub fn get_mut(&mut self, function_id: FunctionID) -> &mut Function<'a>

Get mutable function by ID

source

pub fn unwrap_local( &mut self, function_id: FunctionID, ) -> &mut LocalFunction<'a>

Unwrap local function.

source

pub fn get_local_fid_by_name(&self, name: &str) -> Option<FunctionID>

Get local Function ID by name

source

pub fn get_fn_modifier<'b>( &'b mut self, func_id: FunctionID, ) -> Option<FunctionModifier<'b, 'a>>

Get a function modifier from a function index

source

pub fn set_local_fn_name(&mut self, func_idx: FunctionID, name: String) -> bool

Set the name for a local function. Returns false if it is an imported function.

Trait Implementations§

source§

impl<'a> Clone for Functions<'a>

source§

fn clone(&self) -> Functions<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Functions<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Functions<'a>

source§

fn default() -> Functions<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Functions<'a>

§

impl<'a> RefUnwindSafe for Functions<'a>

§

impl<'a> Send for Functions<'a>

§

impl<'a> Sync for Functions<'a>

§

impl<'a> Unpin for Functions<'a>

§

impl<'a> UnwindSafe for Functions<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.