Skip to main content

canic_core/api/
mod.rs

1//! Public API façade for canister endpoints.
2//!
3//! This module contains thin wrappers exposed to proc-macro–generated
4//! endpoints. Functions here translate public API calls into internal
5//! workflow or ops calls and map internal errors into `Error`.
6//!
7//! No orchestration or business logic should live here.
8//! Any wrapper callable from an endpoint must return a `Result` so errors
9//! are consistently mapped at the boundary.
10
11pub mod auth;
12pub mod cascade;
13pub mod config;
14pub mod error;
15pub mod ic;
16pub mod icts;
17pub mod lifecycle;
18pub mod placement;
19pub mod pool;
20pub mod ready;
21pub mod rpc;
22pub mod runtime;
23pub mod state;
24pub mod template;
25pub mod timer;
26pub mod topology;
27
28///
29/// Workflow Query Re-exports
30///
31/// Only queries that satisfy ALL of the following may be re-exported directly:
32///
33/// - Read-only
34/// - No orchestration or side effects
35/// - No policy or invariant enforcement
36/// - No internal `InternalError` in public signatures
37/// - Return DTOs or primitives only
38///
39/// Queries that can fail with internal errors or enforce invariants
40/// MUST be wrapped in an API façade instead.
41///
42
43pub mod cycles {
44    pub use crate::workflow::runtime::cycles::query::CycleTrackerQuery;
45}
46pub mod env {
47    pub use crate::workflow::env::query::EnvQuery;
48}
49pub mod icrc {
50    pub use crate::workflow::icrc::query::{Icrc10Query, Icrc21Query};
51}
52pub mod log {
53    pub use crate::workflow::log::query::LogQuery;
54}
55pub mod memory {
56    pub use crate::workflow::memory::query::MemoryQuery;
57}
58pub mod metrics {
59    pub use crate::workflow::metrics::query::MetricsQuery;
60}