Skip to main content

Storage

Derive Macro Storage 

Source
#[derive(Storage)]
{
    // Attributes available to this derive:
    #[storage_field]
}
Expand description

The macro implements openbrush::traits::Storage and openbrush::traits::OccupiedStorage traits for each field marked by #[storage_field] attribute. Each field’s type should implement the openbrush::traits::OccupyStorage trait with a unique storage key. Each occupied storage key should be unique for each type otherwise compilation will fail.

OccupyStorage can be implemented for the type manually or automatically via #[openbrush::upgradeable_storage] macro.