Skip to main content

Crate ic_platform_macros

Crate ic_platform_macros 

Source
Expand description

§ic-platform-macros

Implementation support for ic-platform::cdk; consumers declare ic-platform and select its cdk feature. This is a maintained fork of the IC CDK 0.20.3 entrypoint generator, not an executor or runtime implementation.

The default runtime path is ::ic_platform::cdk; the default Candid path is ::ic_platform::candid::contract. Explicit crate = "module::path" and candid = "module::path" overrides retain parsed path validation. Use the matching Candid path in export_candid!(module::path) when overriding it. No-argument export_candid!() uses the Platform contract.

Argument/reply handling, export names, guards, lifecycle restrictions, custom codecs, manual/hidden methods, CDK contexts and spawning preserve upstream 0.20.3 behavior, including skipping quota 10,000. IC_CDK_DEBUG retains the upstream opt-in expansion diagnostics. Caller resource and disclosure policy remain outside the generator. Inherent runtime dependencies stay upstream.

Imported source: dfinity/cdk-rs release revision 624606f7fd1ecd6668e9608594946486aec29167, package ic-cdk-macros 0.20.3. The Apache-2.0 license is retained. Platform maintains the path correction and public entrypoints locally; upstream acceptance is not a delivery prerequisite. The paired ic-platform dependency requires the coordinated package version. Publish both packages through the repository’s workspace workflow.

Macros§

export_candid
Export the service using the Platform Candid contract or an explicit path.

Attribute Macros§

heartbeat
Generate an upstream-compatible heartbeat entrypoint.
init
Generate an upstream-compatible initialization entrypoint.
inspect_message
Generate an upstream-compatible message inspection entrypoint.
on_low_wasm_memory
Generate an upstream-compatible low-Wasm-memory entrypoint.
post_upgrade
Generate an upstream-compatible post-upgrade entrypoint.
pre_upgrade
Generate an upstream-compatible pre-upgrade entrypoint.
query
Generate an upstream-compatible query or composite-query entrypoint.
update
Generate an upstream-compatible update entrypoint.