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 all structs the function returns

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

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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