[][src]Module ink_storage::traits

Traits and interfaces to operate with storage entities.

Generally a type is said to be a storage entity if it implements the SpreadLayout trait. This defines certain constants and routines in order to tell a smart contract how to load and store instances of this type from and to the contract's storage.

The PackedLayout trait can then be implemented on top of the SpreadLayout for types that further allow to be stored in the contract storage in a more compressed format to a single storage cell.

Structs

KeyPtr

A key pointer.

Traits

ExtKeyPtr

Extension trait to make KeyPtr simpler to use for T: SpreadLayout types.

LayoutCryptoHasher

Types implementing this trait are supported layouting crypto hashers.

PackedLayout

Types that can be stored to and loaded from a single contract storage cell.

SpreadLayout

Types that can be stored to and loaded from the contract storage.

StorageLayout

Implemented by types that have a storage layout.

Functions

clear_packed_root

Clears the entity from the contract storage using packed layout.

clear_spread_root

Clears the entity from the contract storage using spread layout.

forward_clear_packed

Clears an instance of type T in packed fashion from the contract storage.

forward_pull_packed

Pulls an instance of type T in packed fashion from the contract storage.

forward_push_packed

Pushes an instance of type T in packed fashion to the contract storage.

pull_packed_root

Pulls an instance of type T from the contract storage using packed layout.

pull_spread_root

Pulls an instance of type T from the contract storage using spread layout.

push_packed_root

Pushes the entitiy to the contract storage using packed layout.

push_spread_root

Pushes the entitiy to the contract storage using spread layout.

Derive Macros

PackedLayout
SpreadLayout
StorageLayout