Expand description
Core Canic library used inside canisters.
Most users should depend on the canic facade crate, which re-exports this crate
under canic::core and exposes 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.
The dependency flow is: endpoints → workflow → policy → ops → model.
Modules§
- api
- Module: api
- cdk
- Module: cdk
- dto
- DTO boundary definitions.
- ids
- Module: ids
- log
- memory
- Module: memory
- perf
- Cross-cutting performance instrumentation.
- protocol
- replay_
policy - Module: replay_policy
Macros§
- eager_
init - Register one eager-init body for execution during lifecycle bootstrap.
- eager_
static - Declare a thread-local static and schedule an eager initialization touch.
- ic_
memory_ key - Declare a stable-memory slot with an explicit authority and ABI-stable key.
- ic_
memory_ range - Declare a MemoryManager ID range owned by an explicit authority.
- impl_
storable_ bounded - impl_storable_bounded
- impl_
storable_ unbounded - impl_storable_unbounded
- log
- perf