Expand description
Interface for accessing the storage from within the runtime.
Structs§
- Host
Functions - Provides implementations for the extern host functions.
Functions§
- append
- Append the encoded
valueto the storage item atkey. - changes_
root - Always returns
None. This function exists for compatibility reasons. - clear
- Clear the storage of the given
keyand its value. - clear_
prefix - Clear the storage of each key-value pair where the key starts with the given
prefix. - commit_
transaction - Commit the last transaction started by
start_transaction. - exists
- Check whether the given
keyexists in storage. - get
- Returns the data for
keyin the storage orNoneif the key can not be found. - next_
key - Get the next key in storage after the given one in lexicographic order.
- read
- Get
keyfrom storage, placing the value intovalue_outand return the number of bytes that the entry in storage has beyond the offset orNoneif the storage entry doesn’t exist at all. Ifvalue_outlength is smaller than the returned length, onlyvalue_outlength bytes are copied intovalue_out. - rollback_
transaction - Rollback the last transaction started by
start_transaction. - root
- “Commit” all existing operations and compute the resulting storage root.
- set
- Set
keytovaluein the storage. - start_
transaction - Start a new nested transaction.