Expand description
APIs/Methods to work with the Internet Computer.
Re-exports§
pub use crate::stable::*;
Functions§
- balance
- The balance of the canister.
- call
- Perform the call and return the response.
- call_
raw - Perform a call.
- call_
with_ payment - caller
- The caller who has invoked this method on the canister.
- data_
certificate - Returns the data certificate authenticating certified_data set by this canister.
- delete
Deprecated - Remove the data associated with the given data type.
- get
Deprecated - Return the data associated with the given type. If the data is not present the default value of the type is returned.
- get_
maybe Deprecated - Return the data that does not implement
Default. - get_mut
Deprecated - Return a mutable reference to the given data type, if the data is not present the default value of the type is constructed and stored. The changes made to the data during updates is preserved.
- id
- ID of the current canister.
- maybe_
with - Like
with, but does not initialize the data with the default value and simply returns None, if there is no value associated with the type. - maybe_
with_ mut - Like
with_mut, but does not initialize the data with the default value and simply returns None, if there is no value associated with the type. - msg_
cycles_ accept - Accept the given amount of cycles, returns the actual amount of accepted cycles.
- msg_
cycles_ available - Return the number of available cycles that is sent by the caller.
- msg_
cycles_ refunded - Return the cycles that were sent back by the canister that was just called. This method should only be called right after an inter-canister call.
- Print a message.
- set_
certified_ data - Set the certified data of the canister, this method traps if data.len > 32.
- spawn
- Execute a future without blocking the current call.
- stable_
bytes - Returns a copy of the stable memory.
- stable_
grow - Tries to grow the memory by new_pages many pages containing zeroes. This system call traps if the previous size of the memory exceeds 2^32 bytes. Errors if the new size of the memory exceeds 2^32 bytes or growing is unsuccessful. Otherwise, it grows the memory and returns the previous size of the memory in pages.
- stable_
read - Reads data from the stable memory location specified by an offset.
- stable_
restore - Restore the data from the stable storage. If the data is not already stored the None value is returned.
- stable_
size - Returns the current size of the stable memory in WebAssembly pages. (One WebAssembly page is 64KiB)
- stable_
store - Store the given data to the stable storage.
- stable_
write - Writes data to the stable memory location specified by an offset.
- store
Deprecated - Store the given data to the storage.
- swap
- Swaps the value associated with type
Twith the given value, returns the old one. - take
- Remove the current value associated with the type and return it.
- time
- The time in nanoseconds.
- trap
- Trap the code.
- with
- Pass an immutable reference to the value associated with the given type to the closure.
- with_
mut - Pass a mutable reference to the value associated with the given type to the closure.