Struct ethabi_fork_ethcontract::Function[][src]

pub struct Function {
    pub name: String,
    pub inputs: Vec<Param>,
    pub outputs: Vec<Param>,
    pub constant: bool,
    pub state_mutability: StateMutability,
}

Contract function specification.

Fields

name: String

Function name.

inputs: Vec<Param>

Function input.

outputs: Vec<Param>

Function output.

constant: bool
👎 Deprecated:

The constant attribute was removed in Solidity 0.5.0 and has been replaced with stateMutability. If parsing a JSON AST created with this version or later this value will always be false, which may be wrong.

Constant function.

state_mutability: StateMutability

Whether the function reads or modifies blockchain state

Implementations

impl Function[src]

pub fn encode_input(&self, tokens: &[Token]) -> Result<Bytes>[src]

Prepares ABI function call with given input params.

pub fn decode_output(&self, data: &[u8]) -> Result<Vec<Token>>[src]

Parses the ABI function output to list of tokens.

pub fn decode_input(&self, data: &[u8]) -> Result<Vec<Token>>[src]

Parses the ABI function input to a list of tokens.

pub fn signature(&self) -> String[src]

Returns a signature that uniquely identifies this function.

Examples:

  • functionName()
  • functionName():(uint256)
  • functionName(bool):(uint256,string)
  • functionName(uint256,bytes32):(string,uint256)

Trait Implementations

impl Clone for Function[src]

impl Debug for Function[src]

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

impl PartialEq<Function> for Function[src]

impl StructuralPartialEq for Function[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.