pub struct ContractIR {Show 15 fields
pub name: String,
pub kind: ContractKind,
pub bases: Vec<Base>,
pub functions: Vec<FunctionIR>,
pub events: Vec<EventIR>,
pub state_variables: Vec<StateVariableIR>,
pub structs: Vec<StructIR>,
pub enums: Vec<EnumIR>,
pub doc: NatspecDocIR,
pub has_using_for_star: bool,
pub has_using_function_list: bool,
pub using_for_libraries: Vec<String>,
pub has_type_definitions: bool,
pub type_aliases: HashMap<String, String>,
pub super_method_map: HashMap<String, String>,
}Expand description
Representation of a Solidity contract.
Fields§
§name: String§kind: ContractKind§bases: Vec<Base>Inheritance specifiers (contract X is A, B(...) { ... }).
functions: Vec<FunctionIR>§events: Vec<EventIR>§state_variables: Vec<StateVariableIR>§structs: Vec<StructIR>§enums: Vec<EnumIR>§doc: NatspecDocIRNatspec documentation for this contract
has_using_for_star: boolWhether this contract contains using X for Y directives.
The compiler merges library functions into the contract wholesale,
so basic using LibName for Type works implicitly. This flag is
set when advanced forms (using X for *, using { f, g } for Y)
are present so that diagnostics can be emitted.
has_using_function_list: bool§using_for_libraries: Vec<String>Library names referenced by using X for Y directives.
The compiler merges all non-builtin library functions into the contract
wholesale, so using LibName for Type member-call syntax (e.g. x.add(y))
resolves to LibName.add(x, y) automatically. This list is kept for
diagnostic purposes.
has_type_definitions: boolWhether this contract contains type X is Y definitions.
type_aliases: HashMap<String, String>User-defined value type aliases (type X is Y).
Maps the user-defined type name to its underlying Solidity type string.
During type resolution, X is transparently replaced by Y.
X.wrap(v) and X.unwrap(v) compile to no-ops.
super_method_map: HashMap<String, String>Mapping from original method name to the renamed super-method name.
When inheritance flattening detects an override, the base version of the
function is preserved as __super_{methodName} and this map records the
relationship so that super.method() can be resolved during IR lowering.
Trait Implementations§
Source§impl Clone for ContractIR
impl Clone for ContractIR
Source§fn clone(&self) -> ContractIR
fn clone(&self) -> ContractIR
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ContractIR
impl RefUnwindSafe for ContractIR
impl Send for ContractIR
impl Sync for ContractIR
impl Unpin for ContractIR
impl UnwindSafe for ContractIR
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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