Struct vapabi::Contract[][src]

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

API building calls to contracts ABI.


constructor: Option<Constructor>

Contract constructor.

functions: HashMap<String, Function>

Contract functions.

events: HashMap<String, Vec<Event>>

Contract events, maps signature to event.

fallback: bool

Contract has fallback function.


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]

Creates function call builder.

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(&self) -> Functions<'_>

Notable traits for Functions<'a>

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

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;

Iterate over all events of the contract in arbitrary order.

pub fn fallback(&self) -> bool[src]

Returns true if contract has fallback

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,