pub struct BeamModule {
pub name: String,
pub attributes: Vec<(String, String)>,
pub functions: Vec<BeamFunction>,
pub exports: Vec<(String, usize)>,
pub on_load: Option<String>,
pub compile_info: HashMap<String, String>,
}Expand description
A BEAM module containing functions and metadata.
Fields§
§name: StringModule name (atom)
attributes: Vec<(String, String)>Module-level attributes (e.g., {vsn, [12345]})
functions: Vec<BeamFunction>All functions defined in the module
exports: Vec<(String, usize)>Exported functions as (Name, Arity) pairs
on_load: Option<String>On-load function (optional)
compile_info: HashMap<String, String>Module info strings (for beam_lib)
Implementations§
Source§impl BeamModule
impl BeamModule
Sourcepub fn add_function(&mut self, func: BeamFunction)
pub fn add_function(&mut self, func: BeamFunction)
Add a function to the module.
Sourcepub fn add_attribute(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
)
pub fn add_attribute( &mut self, key: impl Into<String>, value: impl Into<String>, )
Add a module attribute.
Sourcepub fn find_function(&self, name: &str, arity: usize) -> Option<&BeamFunction>
pub fn find_function(&self, name: &str, arity: usize) -> Option<&BeamFunction>
Find a function by name and arity.
Sourcepub fn export_list(&self) -> Vec<String>
pub fn export_list(&self) -> Vec<String>
Returns the list of exported function keys.
Trait Implementations§
Source§impl Clone for BeamModule
impl Clone for BeamModule
Source§fn clone(&self) -> BeamModule
fn clone(&self) -> BeamModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BeamModule
impl RefUnwindSafe for BeamModule
impl Send for BeamModule
impl Sync for BeamModule
impl Unpin for BeamModule
impl UnsafeUnpin for BeamModule
impl UnwindSafe for BeamModule
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