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
Module: cdk
dto
ids
memory
Module: memory
prelude
protocol

Macros§

build
Embed the shared Canic configuration into a canister crate’s build script.
canic_bundle_discovery_endpoints
Emit the default runtime discovery endpoint bundle.
canic_bundle_nonroot_only_endpoints
Emit the non-root-only runtime endpoint surface.
canic_bundle_observability_endpoints
Emit shared observability and operator-facing diagnostic endpoints.
canic_bundle_root_only_endpoints
Emit the root-only runtime endpoint surface.
canic_bundle_shared_runtime_endpoints
Emit the default shared runtime endpoint surface for all Canic canisters.
canic_bundle_topology_views_endpoints
Emit the standard topology view endpoint bundle.
canic_bundle_wasm_store_runtime_endpoints
Emit the canonical subnet-local wasm-store runtime endpoint surface.
canic_emit_auth_attestation_endpoints
Emit the response-capability and trust-chain runtime endpoint.
canic_emit_blob_storage_billing_endpoints
Emit the Caffeine immutable object-storage billing endpoint surface.
canic_emit_blob_storage_endpoints
Emit the Caffeine immutable object-storage gateway endpoint surface.
canic_emit_canic_metadata_endpoints
Emit the Canic metadata endpoint shared by all Canic canisters.
canic_emit_cycle_tracker_endpoints
Emit the standard cycle-tracker query endpoints.
canic_emit_env_observability_endpoints
Emit the environment snapshot diagnostic endpoint shared by all Canic canisters.
canic_emit_icp_refill_endpoints
Emit the opt-in canister-side ICP-to-cycles refill endpoint.
canic_emit_icrc_standards_endpoints
Emit the ICRC standards-facing query endpoints shared by all Canic canisters.
canic_emit_lifecycle_core_endpoints
Emit the lifecycle and runtime readiness endpoints shared by all Canic canisters.
canic_emit_local_wasm_store_endpoints
Emit the canonical local wasm-store canister endpoint surface.
canic_emit_log_observability_endpoints
Emit runtime log diagnostic endpoints shared by all Canic canisters.
canic_emit_memory_ledger_diagnostic_endpoint
Emit the minimal stable-memory ABI ledger recovery diagnostic endpoint.
canic_emit_metrics_endpoints
Emit the metrics query surface shared by all Canic canisters.
canic_emit_nonroot_auth_attestation_endpoints
Emit the non-root delegated-token issuer provisioning endpoints.
canic_emit_nonroot_sync_topology_endpoints
Emit the non-root sync endpoints used for state and topology propagation.
canic_emit_root_admin_endpoints
Emit root-only control-plane, registry, and operator admin endpoints.
canic_emit_root_auth_attestation_endpoints
Emit root-only auth, delegation, and attestation authority endpoints.
canic_emit_root_wasm_store_endpoints
Emit root-only wasm-store bootstrap and publication control endpoints.
canic_emit_topology_children_endpoints
Emit the shared topology-children query endpoint.
canic_emit_topology_index_endpoints
Emit shared topology index query endpoints.
canic_emit_topology_placement_endpoints
Emit shared scaling and sharding placement view endpoints.
canic_emit_topology_state_endpoints
Emit root-only topology state snapshot endpoints.
finish
Finish a Canic canister module.
impl_storable_bounded
impl_storable_bounded
impl_storable_unbounded
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.