close
Skip to main content

Crate canic

Crate canic 

Source
Expand description

Canic facade crate.

This crate is the recommended dependency for downstream canister projects. It re-exports the public Canic runtime surface and provides the common macro entry points:

  • build! / build_root! for build.rs (validate/embed canic.toml)
  • start! / start_root! for lib.rs (wire lifecycle hooks and export endpoints)

For lower-level access, use the api, cdk, and memory modules. Direct access to internal core modules is intentionally unsupported.

Re-exports§

pub use canic_cdk as cdk;
pub use canic_memory as memory;

Modules§

access
api
dto
ids
prelude
protocol

Macros§

build
Embed the shared Canic configuration into a canister crate’s build script.
build_root
Embed the shared configuration for the root orchestrator canister.
build_root_with
Embed the shared root configuration and run extra build-time generation.
build_with
Embed the shared Canic configuration and run extra build-time generation.
canic_bundle_nonroot_only_endpoints
canic_bundle_observability_endpoints
canic_bundle_root_only_endpoints
canic_bundle_shared_runtime_endpoints
canic_bundle_standards_endpoints
canic_bundle_topology_views_endpoints
canic_bundle_wasm_store_runtime_endpoints
canic_emit_auth_attestation_endpoints
canic_emit_canic_metadata_endpoints
canic_emit_env_observability_endpoints
canic_emit_icrc_standards_endpoints
canic_emit_lifecycle_core_endpoints
canic_emit_local_wasm_store_endpoints
canic_emit_log_observability_endpoints
canic_emit_memory_observability_endpoints
canic_emit_metrics_endpoints
canic_emit_nonroot_auth_attestation_endpoints
canic_emit_nonroot_sync_topology_endpoints
canic_emit_root_admin_endpoints
canic_emit_root_auth_attestation_endpoints
canic_emit_root_wasm_store_endpoints
canic_emit_topology_children_endpoints
canic_emit_topology_cycles_endpoints
canic_emit_topology_index_endpoints
canic_emit_topology_placement_endpoints
canic_emit_topology_state_endpoints
log
Log a runtime entry using Canic’s structured logger.
perf
Record and log elapsed instruction counts since the last perf! invocation in this thread.
start
Configure lifecycle hooks for non-root Canic canisters.
start_root
Configure lifecycle hooks for the root orchestrator canister.
start_wasm_store
Configure lifecycle hooks and the canonical endpoint bundle for a subnet-local wasm_store canister.
timer
timer Schedule a one-shot timer with an auto-generated label.
timer_guarded
timer_guarded Schedule a one-shot timer if none is already scheduled for the slot. Returns true when a new timer was scheduled.
timer_interval
timer_interval Schedule a repeating timer with an auto-generated label.
timer_interval_guarded
timer_interval_guarded Schedule an init timer that installs a repeating timer for the slot. Returns true when a new timer was scheduled.

Structs§

Error

Constants§

CANIC_WASM_CHUNK_BYTES
CRATE_NAME
VERSION

Attribute Macros§

canic_query
Define a Canic query endpoint.
canic_update
Define a Canic update endpoint.