Expand description
Core Canic library used inside canisters.
Canister roles should depend on the canic facade crate, which exposes the
supported API/DTO/ID surfaces and the common entrypoint macros:
canic::build!(inbuild.rs) to validate/embedcanic.tomlcanic::start!(inlib.rs) to wire lifecycle hooks and export endpoints
§Layering
Canic is organized to keep endpoint code thin and coordination centralized:
access/contains access expressions, predicates, and metrics for boundary enforcement.workflow/implements orchestration and lifecycle workflows.domain/policy/pure/contains pure policy decisions invoked by workflow.ops/provides deterministic state access, conversion, and approved single-step effects.model/owns authoritative runtime state and storage invariants.storage/contains passive persisted schemas and stable-memory representations.view/exposes internal read-only projections over stored/runtime state.- macro entrypoints live in the
canicfacade crate.
Endpoints call workflow, which may call policy and ops independently. Ops may call model; policy never calls ops.
Modules§
- api
- Module: api
- ids
- Runtime-owned intent identities and private imports of the shared vocabulary.
- log
- memory
- Module: memory
- perf
- Cross-cutting performance instrumentation.
- replay_
policy - Module: replay_policy
Macros§
- ic_
memory_ key - Declare a stable-memory slot with an explicit authority and ABI-stable key.
- impl_
storable_ bounded - impl_storable_bounded
- impl_
storable_ unbounded - impl_storable_unbounded
- log
- memory_
allocation_ pool - Select the final host pool, including framework grants.
- memory_
bootstrap_ admission - Register the artifact’s composed memory admission before Canic bootstrap.
- perf
Constants§
- CANIC_
WASM_ CHUNK_ BYTES - CANIC_
WASM_ CHUNK_ REQUEST_ MAX_ BYTES - Existing byte-lane envelope, including bounded publication metadata.
- VERSION
- Consts