Derive Macro ink_macro::StorableHint

source ·
#[derive(StorableHint)]
Expand description

Derives ink::storage’s StorableHint trait for the given struct or enum.

If the type declaration contains generic StorageKey, it will use it as salt to generate a combined storage key.

Examples

use ink::storage::traits::{
    Storable,
    StorableHint,
    StorageKey,
    AutoStorableHint,
    AutoKey,
    ManualKey,
};

#[derive(Default, StorableHint, Storable)]
struct NamedFields {
    a: u32,
    b: [u32; 32],
}

let _: NamedFields = <NamedFields as StorableHint<AutoKey>>::Type::default();
let _: NamedFields = <NamedFields as StorableHint<ManualKey<123>>>::Type::default();