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 access;
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 rpc;
21pub mod state;
22pub mod timer;
23pub mod topology;
24pub mod wasm;
25
26///
27/// Workflow Query Re-exports
28///
29/// Only queries that satisfy ALL of the following may be re-exported directly:
30///
31/// - Read-only
32/// - No orchestration or side effects
33/// - No policy or invariant enforcement
34/// - No internal `InternalError` in public signatures
35/// - Return DTOs or primitives only
36///
37/// Queries that can fail with internal errors or enforce invariants
38/// MUST be wrapped in an API façade instead.
39///
40
41pub mod cycles {
42    pub use crate::workflow::runtime::cycles::query::CycleTrackerQuery;
43}
44pub mod env {
45    pub use crate::workflow::env::query::EnvQuery;
46}
47pub mod icrc {
48    pub use crate::workflow::icrc::query::{Icrc10Query, Icrc21Query};
49}
50pub mod log {
51    pub use crate::workflow::log::query::LogQuery;
52}
53pub mod memory {
54    pub use crate::workflow::memory::query::MemoryQuery;
55}
56pub mod metrics {
57    pub use crate::workflow::metrics::query::MetricsQuery;
58}