Struct fuel_ethabi::Contract
source · pub struct Contract {
pub constructor: Option<Constructor>,
pub functions: BTreeMap<String, Vec<Function>>,
pub events: BTreeMap<String, Vec<Event>>,
pub errors: BTreeMap<String, Vec<AbiError>>,
pub receive: bool,
pub fallback: bool,
}
Expand description
API building calls to contracts ABI.
Fields§
§constructor: Option<Constructor>
Contract constructor.
functions: BTreeMap<String, Vec<Function>>
Contract functions.
events: BTreeMap<String, Vec<Event>>
Contract events, maps signature to event.
errors: BTreeMap<String, Vec<AbiError>>
Contract errors, maps signature to error.
receive: bool
Contract has receive function.
fallback: bool
Contract has fallback function.
Implementations§
source§impl Contract
impl Contract
sourcepub fn constructor(&self) -> Option<&Constructor>
pub fn constructor(&self) -> Option<&Constructor>
Creates constructor call builder.
sourcepub fn function(&self, name: &str) -> Result<&Function>
pub fn function(&self, name: &str) -> Result<&Function>
Get the function named name
, the first if there are overloaded
versions of the same function.
sourcepub fn event(&self, name: &str) -> Result<&Event>
pub fn event(&self, name: &str) -> Result<&Event>
Get the contract event named name
, the first if there are multiple.
sourcepub fn error(&self, name: &str) -> Result<&AbiError>
pub fn error(&self, name: &str) -> Result<&AbiError>
Get the contract error named name
, the first if there are multiple.
sourcepub fn events_by_name(&self, name: &str) -> Result<&Vec<Event>>
pub fn events_by_name(&self, name: &str) -> Result<&Vec<Event>>
Get all contract events named name
.
sourcepub fn functions_by_name(&self, name: &str) -> Result<&Vec<Function>>
pub fn functions_by_name(&self, name: &str) -> Result<&Vec<Function>>
Get all functions named name
.
sourcepub fn functions(&self) -> Functions<'_> ⓘ
pub fn functions(&self) -> Functions<'_> ⓘ
Iterate over all functions of the contract in arbitrary order.
Trait Implementations§
source§impl<'a> Deserialize<'a> for Contract
impl<'a> Deserialize<'a> for Contract
source§fn deserialize<D>(deserializer: D) -> Result<Contract, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Contract, D::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more