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 `PublicError`.
6//!
7//! No orchestration or business logic should live here.
8
9pub mod access;
10pub mod app;
11pub mod cascade;
12pub mod config;
13pub mod cycles;
14pub mod env;
15pub mod error;
16pub mod ic;
17pub mod icrc;
18pub mod icts;
19pub mod instrumentation;
20pub mod lifecycle;
21pub mod log;
22pub mod memory;
23pub mod metrics;
24pub mod placement;
25pub mod pool;
26pub mod rpc;
27pub mod state;
28pub mod timer;
29pub mod topology;
30pub mod wasm;
31
32///
33/// EndpointCall
34///
35
36#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
37pub struct EndpointCall {
38    pub endpoint: EndpointId,
39    pub kind: EndpointCallKind,
40}
41
42///
43/// EndpointId
44///
45
46#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
47pub struct EndpointId {
48    pub name: &'static str,
49}
50
51impl EndpointId {
52    #[must_use]
53    pub const fn new(name: &'static str) -> Self {
54        Self { name }
55    }
56}
57
58///
59/// EndpointCallKind
60///
61
62#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
63pub enum EndpointCallKind {
64    Query,
65    QueryComposite,
66    Update,
67}