Struct ethers_core::abi::Function
source · pub struct Function {
pub name: String,
pub inputs: Vec<Param, Global>,
pub outputs: Vec<Param, Global>,
pub constant: Option<bool>,
pub state_mutability: StateMutability,
}
Expand description
Contract function specification.
Fields§
§name: String
Function name.
inputs: Vec<Param, Global>
Function input.
outputs: Vec<Param, Global>
Function output.
constant: Option<bool>
👎Deprecated: The constant attribute was removed in Solidity 0.5.0 and has been replaced with stateMutability.
Constant function.
state_mutability: StateMutability
Whether the function reads or modifies blockchain state
Implementations§
source§impl Function
impl Function
sourcepub fn encode_input(&self, tokens: &[Token]) -> Result<Vec<u8, Global>, Error>
pub fn encode_input(&self, tokens: &[Token]) -> Result<Vec<u8, Global>, Error>
Prepares ABI function call with given input params.
sourcepub fn short_signature(&self) -> [u8; 4]
pub fn short_signature(&self) -> [u8; 4]
Return the 4 byte short signature of this function.
sourcepub fn decode_output(&self, data: &[u8]) -> Result<Vec<Token, Global>, Error>
pub fn decode_output(&self, data: &[u8]) -> Result<Vec<Token, Global>, Error>
Parses the ABI function output to list of tokens.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Function, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Function, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FunctionExt for Function
impl FunctionExt for Function
source§impl Serialize for Function
impl Serialize for Function
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more