#[doc(hidden)]
pub mod __control_plane_core;
pub mod access;
pub mod api;
pub mod bootstrap;
#[doc(hidden)]
pub mod dispatch;
pub mod domain;
pub mod dto;
pub mod error;
mod format;
pub mod ids;
pub mod log;
pub mod perf;
pub mod protocol;
#[cfg(test)]
pub mod test;
pub(crate) mod config;
pub(crate) mod infra;
pub(crate) mod lifecycle;
pub(crate) mod ops;
pub(crate) mod storage;
pub(crate) mod view;
pub(crate) mod workflow;
pub use {
::canic_cdk as cdk,
::canic_memory as memory,
::canic_memory::{eager_init, eager_static, ic_memory, ic_memory_range},
};
pub(crate) use error::{InternalError, InternalErrorClass, InternalErrorOrigin};
#[doc(hidden)]
pub mod __reexports {
pub use ::ctor;
}
pub const CRATE_NAME: &str = env!("CARGO_PKG_NAME");
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const CANIC_MEMORY_MIN: u8 = storage::stable::CANIC_MEMORY_MIN;
pub const CANIC_MEMORY_MAX: u8 = storage::stable::CANIC_MEMORY_MAX;
pub const CANIC_WASM_CHUNK_BYTES: usize = 1_048_576;
#[macro_export]
macro_rules! perf {
($($label:tt)*) => {{
$crate::perf::PERF_LAST.with(|last| {
let now = $crate::perf::perf_counter();
let then = *last.borrow();
let delta = now.saturating_sub(then);
*last.borrow_mut() = now;
let label = format!($($label)*);
$crate::perf::record_checkpoint(module_path!(), &label, delta);
});
}};
}
#[cfg(test)]
#[macro_export]
macro_rules! assert_err_variant {
($err:expr, $pat:pat $(if $guard:expr)? $(,)?) => {{
match $err {
$pat $(if $guard)? => {}
other => panic!("unexpected error variant: {other:?}"),
}
}};
}