canic_core/api/
wasm.rs

1use crate::{ids::CanisterRole, workflow::runtime::wasm::WasmWorkflow};
2
3///
4/// WasmApi
5///
6/// Runtime WASM registration API.
7///
8/// Public, user-callable helpers for registering embedded WASM modules
9/// during canister initialization.
10///
11/// This module exists to expose a stable surface to downstream canisters
12/// without making `WasmOps` public.
13///
14/// Layering:
15///     user canister → api → ops → runtime state
16///
17
18pub struct WasmApi;
19
20impl WasmApi {
21    pub fn import_static(wasms: &'static [(CanisterRole, &[u8])]) {
22        WasmWorkflow::import_static(wasms);
23    }
24
25    /// Quiet variant without logging.
26    pub fn import_static_quiet(wasms: &'static [(CanisterRole, &[u8])]) {
27        WasmWorkflow::import_static_quiet(wasms);
28    }
29}