Struct ethabi_fork_ethcontract::Contract[][src]

pub struct Contract {
    pub constructor: Option<Constructor>,
    pub functions: HashMap<String, Vec<Function>>,
    pub events: HashMap<String, Vec<Event>>,
    pub receive: bool,
    pub fallback: bool,
}

API building calls to contracts ABI.

Fields

constructor: Option<Constructor>

Contract constructor.

functions: HashMap<String, Vec<Function>>

Contract functions.

events: HashMap<String, Vec<Event>>

Contract events, maps signature to event.

receive: bool

Contract has receive function.

fallback: bool

Contract has fallback function.

Implementations

impl Contract[src]

pub fn load<T: Read>(reader: T) -> Result<Self>[src]

Loads contract from json.

pub fn constructor(&self) -> Option<&Constructor>[src]

Creates constructor call builder.

pub fn function(&self, name: &str) -> Result<&Function>[src]

Get the function named name, the first if there are overloaded versions of the same function.

pub fn event(&self, name: &str) -> Result<&Event>[src]

Get the contract event named name, the first if there are multiple.

pub fn events_by_name(&self, name: &str) -> Result<&Vec<Event>>[src]

Get all contract events named name.

pub fn functions_by_name(&self, name: &str) -> Result<&Vec<Function>>[src]

Get all functions named name.

pub fn functions(&self) -> Functions<'_>

Notable traits for Functions<'a>

impl<'a> Iterator for Functions<'a> type Item = &'a Function;
[src]

Iterate over all functions of the contract in arbitrary order.

pub fn events(&self) -> Events<'_>

Notable traits for Events<'a>

impl<'a> Iterator for Events<'a> type Item = &'a Event;
[src]

Iterate over all events of the contract in arbitrary order.

Trait Implementations

impl Clone for Contract[src]

impl Debug for Contract[src]

impl<'a> Deserialize<'a> for Contract[src]

impl PartialEq<Contract> for Contract[src]

impl StructuralPartialEq for Contract[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.