pub struct Module {
pub functions: Vec<Function>,
pub state_variables: Vec<StateVariable>,
pub events: Vec<Event>,
}Expand description
IR module representing a compiled contract
Fields§
§functions: Vec<Function>§state_variables: Vec<StateVariable>§events: Vec<Event>Implementations§
Source§impl Module
impl Module
Sourcepub fn constructor(&self) -> Option<&Function>
pub fn constructor(&self) -> Option<&Function>
Get the constructor function if present
Sourcepub fn get_function(&self, name: &str) -> Option<&Function>
pub fn get_function(&self, name: &str) -> Option<&Function>
Get a function by name
Sourcepub fn instruction_count(&self) -> usize
pub fn instruction_count(&self) -> usize
Count total instructions across all functions
§impl Module
impl Module
pub fn from_contract( metadata: &ContractMetadata, ) -> Result<Self, Vec<IrDiagnostic>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more