Module ic

Module ic 

Source
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.
deleteDeprecated
Remove the data associated with the given data type.
getDeprecated
Return the data associated with the given type. If the data is not present the default value of the type is returned.
get_maybeDeprecated
Return the data that does not implement Default.
get_mutDeprecated
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
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.
storeDeprecated
Store the given data to the storage.
swap
Swaps the value associated with type T with 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.