pub struct Function {
pub name: String,
pub inputs: Vec<Param>,
pub outputs: Vec<Param>,
pub constant: bool,
}
Expand description
Contract function specification.
Fields
name: String
Function name.
inputs: Vec<Param>
Function input.
outputs: Vec<Param>
Function output.
constant: bool
Constant function.
Implementations
sourceimpl 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 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
sourceimpl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
sourcefn 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
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub 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