pub struct Contract { /* private fields */ }
Expand description

Contract is directly associated to a contract in the network provided by the Worker that creates it. This type offers methods to interact with any network, such as creating transactions and calling into contract functions.

Implementations

Grab the current contract’s account identifier

Casts the current Contract into an Account type. This does nothing on chain/network, and is merely allowing Account::* functions to be used from this Contract.

Call the current contract’s function using the contract’s own account details to do the signing. Returns a CallTransaction object that we will make use to populate the rest of the call details.

If we want to make use of the contract’s account to call into a different contract besides the current one, use contract.as_account().call instead.

Call a view function into the current contract. Returns a result that yields a JSON string object.

View the WASM code bytes of this contract.

View a contract’s state map of key value pairs.

Views the current contract’s details such as balance and storage usage.

Deletes the current contract, and returns the execution details of this transaction. The beneciary will receive the funds of the account deleted

Start a batch transaction, using the current contract as the signer and making calls into this contract. Returns a Transaction object that we can use to add Actions to the batched transaction. Call transact to send the batched transaction to the network.

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 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