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