Struct fuel_ethabi::Function
source · pub struct Function {
pub name: String,
pub inputs: Vec<Param>,
pub outputs: Vec<Param>,
pub constant: Option<bool>,
pub state_mutability: StateMutability,
}
Expand description
Contract function specification.
Fields§
§name: String
Function name.
inputs: Vec<Param>
Function input.
outputs: Vec<Param>
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<Bytes>
pub fn encode_input(&self, tokens: &[Token]) -> Result<Bytes>
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>>
pub fn decode_output(&self, data: &[u8]) -> Result<Vec<Token>>
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more