Derive Macro near_contract_tools::Migrate

source ·
#[derive(Migrate)]
{
    // Attributes available to this derive:
    #[migrate]
}
Expand description

Migrate a contract’s default struct from one schema to another.

Fields may be specified in the #[migrate(...)] attribute.

Fields include:

  • from Old default struct type to convert from. (required)
  • to New default struct type to convert into. (optional, default: Self)
  • convert Identifier of a function that converts from the old schema to the new schema. Mutually exclusive with convert_with_args. (optional, default: <Self::NewSchema as From<Self::OldSchema>>::from)
  • convert_with_args Identifier of a function that converts from the old schema to the new schema and accepts a single String argument. Mutually exclusive with convert. (optional)
  • allow Expression to evaluate before allowing