pub struct Contract {
pub macros: Vec<MacroDefinition>,
pub invocations: Vec<MacroInvocation>,
pub imports: Vec<FilePath>,
pub constants: Vec<ConstantDefinition>,
pub functions: Vec<Function>,
pub events: Vec<Event>,
pub tables: Vec<Table>,
}Expand description
A Huff Contract Representation
This is the representation of a contract as it is parsed from huff source code. Thus, it is also the root of the AST.
For examples of Huff contracts, see the huff-examples repository.
Fields§
§macros: Vec<MacroDefinition>Macro definitions
invocations: Vec<MacroInvocation>Invocations of macros
imports: Vec<FilePath>File Imports
constants: Vec<ConstantDefinition>Constants
functions: Vec<Function>Functions
events: Vec<Event>Events
tables: Vec<Table>Tables
Implementations§
Source§impl Contract
impl Contract
Sourcepub fn find_macro_by_name(&self, name: &str) -> Option<MacroDefinition>
pub fn find_macro_by_name(&self, name: &str) -> Option<MacroDefinition>
Returns the first macro that matches the provided name
Sourcepub fn derive_storage_pointers(&mut self)
pub fn derive_storage_pointers(&mut self)
Derives the FreeStoragePointers into their bytes32 representation
Trait Implementations§
Source§impl Ord for Contract
impl Ord for Contract
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Contract
impl PartialOrd for Contract
impl Eq for Contract
impl StructuralPartialEq for Contract
Auto Trait Implementations§
impl Freeze for Contract
impl RefUnwindSafe for Contract
impl Send for Contract
impl Sync for Contract
impl Unpin for Contract
impl UnsafeUnpin for Contract
impl UnwindSafe for Contract
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