Struct ic_utils::canister::Canister[][src]

pub struct Canister<'agent, T = ()> { /* fields omitted */ }
Expand description

Create an encapsulation of a Canister running on the Internet Computer. This supports making calls to methods, installing code if needed, and various utilities related to a canister.

This is the higher level construct for talking to a canister on the Internet Computer.

Implementations

Get the canister ID of this canister.

Get the interface object from this canister. Sometimes those interfaces might have custom methods that are useful.

Create an AsyncCallBuilder to do an update call.

Create a SyncCallBuilder to do a query call.

Create a CanisterBuilder instance to build a canister abstraction.

Get the status of a canister.

Create a canister.

This method deposits the cycles included in this call into the specified canister. Only the controller of the canister can deposit cycles.

Deletes a canister.

Until developers can convert real ICP tokens to a top up an existing canister, the system provides the provisional_top_up_canister method. It adds amount cycles to the balance of canister identified by amount (implicitly capping it at MAX_CANISTER_BALANCE).

This method takes no input and returns 32 pseudo-random bytes to the caller. The return value is unknown to any part of the IC at time of the submission of this call. A new return value is generated for each call to this method.

Starts a canister.

Stop a canister.

This method removes a canister’s code and state, making the canister empty again. Only the controller of the canister can uninstall code. Uninstalling a canister’s code will reject all calls that the canister has not yet responded to, and drop the canister’s code and state. Outstanding responses to the canister will not be processed, even if they arrive after code has been installed again. The canister is now empty. In particular, any incoming or queued calls will be rejected.

Install a canister, with all the arguments necessary for creating the canister.

Update one or more of a canisters settings (i.e its controller, compute allocation, or memory allocation.)

Get the current controller’s principal ID.

Transfer controller to another principal ID.

Get the list of custodians.

Authorize a new custodian.

Deauthorize a custodian.

Get the balance.

Send cycles to another (hopefully Wallet) canister.

Send cycles to another (hopefully Wallet) canister.

Create a wallet canister

Store the wallet WASM inside the wallet canister. This is needed to enable wallet_create_wallet

Forward a call to another canister, including an amount of cycles from the wallet.

Forward a call using another call’s builder. This takes an UpdateBuilder, marshalls it to a buffer, and sends it through the wallet canister, adding a separate amount.

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

Performs the conversion.

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

Performs the conversion.

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.