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 lifecycle;
17pub mod memory;
18pub mod metadata;
19pub mod placement;
20pub mod pool;
21pub mod ready;
22pub mod rpc;
23pub mod runtime;
24pub mod state;
25pub mod timer;
26pub mod topology;
27
28///
29/// Read-only 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 metrics {
56 pub use crate::workflow::metrics::query::MetricsQuery;
57}