pub struct Function<'a> { /* 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

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.

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.

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.

Similiar to args, specify an argument that is borsh serializable and can be accepted by the equivalent contract.

Specify the amount of tokens to be deposited where deposit is the amount of tokens in yocto near.

Specify the amount of gas to be used.

Use the maximum amount of gas possible to perform this function call into the contract.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more