[][src]Struct ethers_core::abi::Function

pub struct Function {
    pub name: String,
    pub inputs: Vec<Param>,
    pub outputs: Vec<Param>,
    pub state_mutability: StateMutability,
}
This is supported on feature="abi" only.

Contract function specification.

Fields

name: String
This is supported on feature="abi" only.

Function name.

inputs: Vec<Param>
This is supported on feature="abi" only.

Function input.

outputs: Vec<Param>
This is supported on feature="abi" only.

Function output.

state_mutability: StateMutability
This is supported on feature="abi" only.

Function state mutability

Implementations

impl Function[src]

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

This is supported on feature="abi" only.

Prepares ABI function call with given input params.

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

This is supported on feature="abi" only.

Parses the ABI function output to list of tokens.

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

This is supported on feature="abi" only.

Parses the ABI function input to a list of tokens.

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

This is supported on feature="abi" only.

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 FunctionExt for Function[src]

impl PartialEq<Function> for Function[src]

impl Serialize 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.

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