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! for configured canisters and generated local sandbox/probe config
  • start! 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.

Modules§

access
Public access helpers re-exported from the core access layer.
api
cdk
dto
ids
memory
Canic-managed stable-memory runtime boundary.
prelude
protocol

Macros§

build
Embed the shared Canic configuration into a canister crate’s build script.
canic_bundle_discovery_endpoints
canic_bundle_nonroot_only_endpoints
canic_bundle_observability_endpoints
canic_bundle_root_only_endpoints
canic_bundle_shared_runtime_endpoints
canic_bundle_topology_views_endpoints
canic_bundle_wasm_store_runtime_endpoints
canic_emit_auth_attestation_endpoints
canic_emit_canic_metadata_endpoints
canic_emit_cycle_tracker_endpoints
canic_emit_env_observability_endpoints
canic_emit_icp_refill_endpoints
Emit the opt-in canister-side ICP-to-cycles refill endpoint.
canic_emit_icrc_standards_endpoints
canic_emit_lifecycle_core_endpoints
canic_emit_local_wasm_store_endpoints
canic_emit_log_observability_endpoints
canic_emit_memory_ledger_diagnostic_endpoint
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_index_endpoints
canic_emit_topology_placement_endpoints
canic_emit_topology_state_endpoints
canic_internal_client
Generate a typed client for protected Canic internal update endpoints.
canic_protected_endpoint
Define a shared descriptor for a protected Canic internal update endpoint.
finish
Finish a Canic canister module.
impl_storable_bounded
Storable helpers
impl_storable_unbounded
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 Canic canisters.
start_local
Configure a local-only non-root Canic canister for manual development.
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_DEFAULT_UPDATE_INGRESS_MAX_BYTES
CANIC_WASM_CHUNK_BYTES
CRATE_NAME
VERSION

Attribute Macros§

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