Trait ink_storage::traits::SpreadAllocate
source · [−]pub trait SpreadAllocate: SpreadLayout {
fn allocate_spread(ptr: &mut KeyPtr) -> Self;
}
Expand description
Types that can be default initialized to some area of the contract storage.
Required methods
fn allocate_spread(ptr: &mut KeyPtr) -> Self
fn allocate_spread(ptr: &mut KeyPtr) -> Self
Default initializes the implementing type using spread layout.
Note
- The key pointer denotes the position in contract storage where the instance is being allocated at.
- Fields of
Self
are allocated in order and constructSelf
upon completion.