Skip to main content

freeze_struct

Attribute Macro freeze_struct 

Source
#[freeze_struct]
Expand description

Freezes the layout of a struct to the current hash of its fields, ensuring that future changes require updating the hash.

use subtensor_macros::freeze_struct;

#[freeze_struct("13f75e4ea46b4e80")]
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct MyStruct {
    pub a: u32,
    pub b: u64,
}