Crate ic_cdk_macros

source ·
Expand description

Documentation Crates.io License Downloads CI

§ic-cdk-macros

This crate provides a set of macros to facilitate canister development.

The macros fall into two categories:

  • To register functions as canister entry points
  • To export Candid definitions

§Register functions as canister entry points

These macros are directly related to the Internet Computer Specification.

§Export Candid definitions

Check Generating Candid files for Rust canisters for more details.

Macros§

  • Create a get_candid_pointer method so that dfx can execute it to extract candid definition.

Attribute Macros§

  • Register the canister_heartbeat entry point of a canister.
  • Register the canister_init entry point of a canister.
  • Register the canister_inspect_message entry point of a canister.
  • Register the canister_post_upgrade entry point of a canister.
  • Register the canister_pre_upgrade entry point of a canister.
  • Register a query call entry point.
  • Register an update call entry point.