Struct ethers::abi::AbiParser [−][src]
pub struct AbiParser {
pub structs: HashMap<String, SolStruct, RandomState>,
pub struct_tuples: HashMap<String, Vec<ParamType, Global>, RandomState>,
pub function_params: HashMap<(String, String), String, RandomState>,
pub outputs: HashMap<String, Vec<String, Global>, RandomState>,
}
Expand description
A parser that turns a “human readable abi” into a Abi
Fields
structs: HashMap<String, SolStruct, RandomState>
solidity structs
struct_tuples: HashMap<String, Vec<ParamType, Global>, RandomState>
solidity structs as tuples
function_params: HashMap<(String, String), String, RandomState>
(function name, param name) -> struct which are the identifying properties we get the name from ethabi.
outputs: HashMap<String, Vec<String, Global>, RandomState>
(function name) -> Vec
Implementations
Parses a “human readable abi” string
Example
let abi = AbiParser::default().parse_str(r#"[
function setValue(string)
function getValue() external view returns (string)
event ValueChanged(address indexed author, string oldValue, string newValue)
]"#).unwrap();
Parses a “human readable abi” string vector
Example
use ethers_core::abi::AbiParser;
let abi = AbiParser::default().parse(&[
"function x() external view returns (uint256)",
]).unwrap();
Link additional structs for parsing
Parses a solidity event declaration from event <name> (args*) anonymous?
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AbiParser
impl UnwindSafe for AbiParser
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more