Struct ethers_core::abi::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<Vec<u8>, Error>
pub fn encode_input(&self, tokens: &[Token]) -> Result<Vec<u8>, 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>, Error>
pub fn decode_output(&self, data: &[u8]) -> Result<Vec<Token>, 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 PartialEq for Function
impl PartialEq 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
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more