Crate canic

Crate canic 

Source
Expand description

CANIC crate utilities for multi-canister apps on the Internet Computer.

Modules§

auth
Authorization helpers for canister-to-canister and user calls.
cdk
config
env
Environment constants grouped by domain (ck, NNS, SNS).
export
guard
interface
Interface Helpers Aggregates thin wrappers around external canisters (IC, ck-tokens, ICRC).
macros
Public macro entry points used across Canic.
memory
ops
Business-logic helpers that sit between endpoint handlers and the state layer.
prelude
Prelude
runtime
spec
Canonical representations of external IC specs (ICRC, NNS, SNS, etc.). This module corrals the verbose candid bindings so the rest of the codebase can import clean wrappers with consistent naming.
state
types
Shared type wrappers and aliases used across the ops and endpoint layers.
utils
Utility helpers shared across canisters: serialization, formatting, time, random number generation, and WASM helpers. Each submodule provides a small focused toolkit used by the ops and state layers.

Macros§

auth_require_all
Enforce that every supplied rule future succeeds for the current caller.
auth_require_any
Enforce that at least one supplied rule future succeeds for the current caller.
canic_build
Embed the shared Canic configuration into a canister crate’s build script.
canic_build_root
Embed the shared configuration for the root orchestrator canister.
canic_endpoints
canic_endpoints_nonroot
canic_endpoints_root
canic_start
Configure lifecycle hooks for non-root Canic canisters.
canic_start_root
Configure lifecycle hooks for the root Canic orchestrator canister.
eager_init
Run $body during process start-up using ctor.
eager_static
Declare a thread-local static and schedule an eager initialization touch.
ic_memory
Declare a stable-memory slot backed by the Canic memory registry.
ic_memory_range
Reserve a contiguous block of stable-memory IDs for the current crate.
impl_storable_bounded
Implement Storable with a bounded size guarantee.
impl_storable_unbounded
Implement Storable without a size bound.
log
Emit a structured log line with consistent coloring and headers.
perf
Log elapsed instruction counts since the last perf! invocation.
perf_start
Record a single-call instruction counter snapshot when the surrounding scope exits.

Enums§

Error
Error
Log
Log

Constants§

CANISTER_INIT_DELAY
Constants
CRATE_NAME
Crate Version
LOG_CANISTER_TYPE_ELLIPSIS_THRESHOLD
LOG_CANISTER_TYPE_WIDTH
Logging layout constants
VERSION

Derive Macros§

ThisError