1#[doc(hidden)]
22pub mod __control_plane_core;
23#[doc(hidden)]
24pub mod access;
25pub mod api;
26#[doc(hidden)]
27pub mod bootstrap;
28#[doc(hidden)]
29pub mod dispatch;
30pub mod dto;
31#[doc(hidden)]
32pub mod error;
33mod format;
34pub mod ids;
35#[doc(hidden)]
36pub mod ingress;
37pub mod log;
38pub mod perf;
39pub mod protocol;
40#[cfg(test)]
41pub mod test;
42
43pub(crate) mod config;
44pub(crate) mod domain;
45pub(crate) mod infra;
46pub(crate) mod lifecycle;
47pub(crate) mod ops;
48pub(crate) mod storage;
49pub(crate) mod view;
50pub(crate) mod workflow;
51
52pub use {
53 ::canic_cdk as cdk,
54 ::canic_memory as memory,
55 ::canic_memory::{eager_init, eager_static, ic_memory, ic_memory_range},
56};
57
58pub(crate) use error::{InternalError, InternalErrorClass, InternalErrorOrigin};
59
60#[doc(hidden)]
63pub mod __reexports {
64 pub use ::ctor;
65}
66
67pub const CRATE_NAME: &str = env!("CARGO_PKG_NAME");
72pub const VERSION: &str = env!("CARGO_PKG_VERSION");
73pub const CANIC_MEMORY_MIN: u8 = storage::stable::CANIC_MEMORY_MIN;
74pub const CANIC_MEMORY_MAX: u8 = storage::stable::CANIC_MEMORY_MAX;
75pub const CANIC_WASM_CHUNK_BYTES: usize = 1_048_576;
78
79#[macro_export]
80macro_rules! perf {
81 ($($label:tt)*) => {{
82 $crate::perf::PERF_LAST.with(|last| {
83 let now = $crate::perf::perf_counter();
84 let then = *last.borrow();
85 let delta = now.saturating_sub(then);
86
87 *last.borrow_mut() = now;
88
89 let label = format!($($label)*);
90 $crate::perf::record_checkpoint(module_path!(), &label, delta);
91 });
92 }};
93}
94
95#[cfg(test)]
96#[macro_export]
97macro_rules! assert_err_variant {
98 ($err:expr, $pat:pat $(if $guard:expr)? $(,)?) => {{
99 match $err {
100 $pat $(if $guard)? => {}
101 other => panic!("unexpected error variant: {other:?}"),
102 }
103 }};
104}