Struct and its Abilities
Struct is a way of defining custom type in move. It can be described as a simple key-value storage where key is a name of property and value is what's stored.
Syntax:
Struct can have up to 4 abilities which define how values of this type can be used, dropped or stored.
Copy - value can be copied (or cloned by value).
Drop - value can be dropped by the end of scope.
Key - value can be used as a key for global storage operations.
Store - value can be stored inside global storage.
Abilities for Primitive types like integers, vector, addresses and boolean are pre-defined and unchangeable : copy, drop and store.
Last updated