ic_cdk

Attribute Macro pre_upgrade

Source
#[pre_upgrade]
Expand description

Register the canister_pre_upgrade entry point of a canister.

This attribute macro will export the function canister_pre_upgrade in the canister module.

The function under this attribute must have no return value.

Each canister can only have one canister_pre_upgrade entry point.

ยงExample

#[pre_upgrade]
fn pre_upgrade_function() {
    // ...
}