Store
trait. While native types (like felt252
, u128
, etc.) can be stored directly, custom types need this additional step to generate the necessary implementation on how to handle their storage.
To make a custom type storable:
starknet::Store
trait for your structDrop
, Serde
, and Copy
Person
struct:
Store
trait manually instead of deriving it.Store
trait, Cairo automatically generates the necessary storage pointers for each struct member. This allows you to access and modify individual fields of your stored struct directly: