Module storage

Source
Expand description

Defines functions for reading and writing into Contract Storage (a.k.a. ‘World State’). It also defines two types: ‘Storage’ and ‘StoragePath’, that are used in macro-expanded code in a convoluted and hard-to-explain manner. These types will be moved out of this module, or removed entirely, in a future version of the SDK.

Structs§

Cacher
Cacher is data wrapper to support Lazy Read and Lazy Write to Contract Storage.
StoragePath
StoragePath defines the key format in canonical path for fields in contract storage

Traits§

Storable
Storable trait provides functions as wrapper to getter and setter to the key-value storage in world-state. Impl of this trait is generated by macro. To avoid conflict with user function, function names in this trait are prefix with two underscores.

Functions§

get
Gets the value, if any, associated with the provided key in this Contract Storage.
get_network_state
Gets the value, if any, associated with the provided key in Network Account’s Storage.
set
Binds the provided key to the provided value in this Contract’s Storage.