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