Struct near_workspaces::operations::Function
source · pub struct Function { /* private fields */ }Expand description
A set of arguments we can provide to a transaction, containing the function name, arguments, the amount of gas to use and deposit.
Implementations§
source§impl Function
impl Function
sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Initialize a new instance of Function, tied to a specific function on a
contract that lives directly on a contract we’ve specified in Transaction.
sourcepub fn args(self, args: Vec<u8>) -> Self
pub fn args(self, args: Vec<u8>) -> Self
Provide the arguments for the call. These args are serialized bytes from either
a JSON or Borsh serializable set of arguments. To use the more specific versions
with better quality of life, use args_json or args_borsh.
sourcepub fn args_json<U: Serialize>(self, args: U) -> Self
pub fn args_json<U: Serialize>(self, args: U) -> Self
Similiar to args, specify an argument that is JSON serializable and can be
accepted by the equivalent contract. Recommend to use something like
serde_json::json! macro to easily serialize the arguments.
sourcepub fn args_borsh<U: BorshSerialize>(self, args: U) -> Self
pub fn args_borsh<U: BorshSerialize>(self, args: U) -> Self
Similiar to args, specify an argument that is borsh serializable and can be
accepted by the equivalent contract.