Struct cranelift_module::ModuleDeclarations[][src]

pub struct ModuleDeclarations { /* fields omitted */ }
Expand description

This provides a view to the state of a module which allows ir::ExternalNames to be translated into FunctionDeclarations and DataDeclarations.

Implementations

impl ModuleDeclarations[src]

pub fn get_name(&self, name: &str) -> Option<FuncOrDataId>[src]

Get the module identifier for a given name, if that name has been declared.

pub fn get_functions(
    &self
) -> impl Iterator<Item = (FuncId, &FunctionDeclaration)>
[src]

Get an iterator of all function declarations

pub fn is_function(name: &ExternalName) -> bool[src]

Return whether name names a function, rather than a data object.

pub fn get_function_decl(&self, func_id: FuncId) -> &FunctionDeclaration[src]

Get the FunctionDeclaration for the function named by name.

pub fn get_data_objects(
    &self
) -> impl Iterator<Item = (DataId, &DataDeclaration)>
[src]

Get an iterator of all data declarations

pub fn get_data_decl(&self, data_id: DataId) -> &DataDeclaration[src]

Get the DataDeclaration for the data object named by name.

pub fn declare_function(
    &mut self,
    name: &str,
    linkage: Linkage,
    signature: &Signature
) -> ModuleResult<(FuncId, &FunctionDeclaration)>
[src]

Declare a function in this module.

pub fn declare_data(
    &mut self,
    name: &str,
    linkage: Linkage,
    writable: bool,
    tls: bool
) -> ModuleResult<(DataId, &DataDeclaration)>
[src]

Declare a data object in this module.

Trait Implementations

impl Debug for ModuleDeclarations[src]

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

Formats the value using the given formatter. Read more

impl Default for ModuleDeclarations[src]

fn default() -> ModuleDeclarations[src]

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

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.