[][src]Struct ethereum_abi::Abi

pub struct Abi {
    pub constructor: Option<Constructor>,
    pub functions: Vec<Function>,
    pub events: Vec<Event>,
    pub has_receive: bool,
    pub has_fallback: bool,
}

Contract ABI (Abstract Binary Interface).

This struct holds defitions for a contracts' ABI.

use std::str::FromStr;
use ethereum_abi::Abi;

let abi_json =  r#"[{
    "type": "function",
    "name": "f",
    "inputs": [{"type": "uint256", "name": "x"}]}
]"#;

let abi = Abi::from_str(abi_json).unwrap();

Fields

constructor: Option<Constructor>

Contract constructor definition (if it defines one).

functions: Vec<Function>

Contract defined functions.

events: Vec<Event>

Contract defined events.

has_receive: bool

Whether the contract has the receive method defined.

has_fallback: bool

Whether the contract has the fallback method defined.

Implementations

impl Abi[src]

pub fn from_reader<R>(rdr: R) -> Result<Abi> where
    R: Read
[src]

Parses a JSON ABI definition from a reader (e.g. a file handle).

impl Abi[src]

pub fn decode_input_from_slice<'a>(
    &'a self,
    input: &[u8]
) -> Result<(&'a Function, DecodedParams)>
[src]

pub fn decode_input_from_hex<'a>(
    &'a self,
    input: &str
) -> Result<(&'a Function, DecodedParams)>
[src]

pub fn decode_log_from_slice<'a>(
    &'a self,
    topics: &[H256],
    data: &[u8]
) -> Result<(&'a Event, DecodedParams)>
[src]

Decode event data from slice.

Trait Implementations

impl Clone for Abi[src]

impl Debug for Abi[src]

impl<'de> Deserialize<'de> for Abi[src]

impl Eq for Abi[src]

impl FromStr for Abi[src]

type Err = Error

The associated error which can be returned from parsing.

pub fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Parses a JSON ABI definition from a string.

impl PartialEq<Abi> for Abi[src]

impl StructuralEq for Abi[src]

impl StructuralPartialEq for Abi[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> Conv for T

impl<T> Conv for T

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

impl<T> FmtForward for T

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

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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.

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