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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
sourcefn 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
sourceimpl FunctionExt for Function
impl FunctionExt for Function
sourceimpl Serialize for Function
impl Serialize for Function
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more