Struct ethers_contract_abigen::InternalStructs
source · pub struct InternalStructs { /* private fields */ }
Expand description
Helper to match ethabi::Param
s with structs and nested structs
This is currently used to get access to all the unique solidity structs used as function
in/output until ethabi
supports it as well.
Implementations§
source§impl InternalStructs
impl InternalStructs
sourcepub fn new(abi: RawAbi) -> Self
pub fn new(abi: RawAbi) -> Self
Creates a new instance with a filled type mapping table based on the abi
sourcepub fn get_function_input_struct_type(
&self,
function: &str,
input: &str
) -> Option<&str>
pub fn get_function_input_struct_type( &self, function: &str, input: &str ) -> Option<&str>
Returns the name of the rust type that will be generated if the given input is a struct NOTE: this does not account for arrays or fixed arrays
sourcepub fn get_function_input_struct_solidity_id(
&self,
function: &str,
input: &str
) -> Option<&str>
pub fn get_function_input_struct_solidity_id( &self, function: &str, input: &str ) -> Option<&str>
Returns solidity type identifier as it’s used in the ABI.
sourcepub fn get_event_input_struct_type(
&self,
event: &str,
idx: usize
) -> Option<&str>
pub fn get_event_input_struct_type( &self, event: &str, idx: usize ) -> Option<&str>
Returns the name of the rust type that will be generated if the given input is a struct
This takes the index of event’s parameter instead of the parameter’s name like
Self::get_function_input_struct_type
does because we can’t rely on the name since events
support nameless parameters NOTE: this does not account for arrays or fixed arrays
sourcepub fn get_event_input_struct_solidity_id(
&self,
event: &str,
idx: usize
) -> Option<&str>
pub fn get_event_input_struct_solidity_id( &self, event: &str, idx: usize ) -> Option<&str>
Returns the type identifier as it’s used in the solidity ABI
sourcepub fn get_function_output_struct_type(
&self,
function: &str,
internal_type: &str
) -> Option<&str>
pub fn get_function_output_struct_type( &self, function: &str, internal_type: &str ) -> Option<&str>
Returns the name of the rust type that will be generated if the given output is a struct NOTE: this does not account for arrays or fixed arrays
sourcepub fn get_function_output_struct_solidity_id(
&self,
function: &str,
internal_type: &str
) -> Option<&str>
pub fn get_function_output_struct_solidity_id( &self, function: &str, internal_type: &str ) -> Option<&str>
Returns the name of the rust type that will be generated if the given output is a struct NOTE: this does not account for arrays or fixed arrays
sourcepub fn get_struct_type(&self, internal_type: &str) -> Option<&str>
pub fn get_struct_type(&self, internal_type: &str) -> Option<&str>
Returns the name of the rust type for the type
sourcepub fn rust_type_names(&self) -> &HashMap<String, String>
pub fn rust_type_names(&self) -> &HashMap<String, String>
Returns the mapping table of abi internal type identifier -> rust type
sourcepub fn structs_types(&self) -> &HashMap<String, SolStruct>
pub fn structs_types(&self) -> &HashMap<String, SolStruct>
Returns all the solidity struct types
These are grouped by their case-sensitive type identifiers extracted from the ABI.
Trait Implementations§
source§impl Clone for InternalStructs
impl Clone for InternalStructs
source§fn clone(&self) -> InternalStructs
fn clone(&self) -> InternalStructs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more