canic_core/ops/
wasm.rs

1use crate::{Error, ids::CanisterRole, model::wasm::WasmRegistry, types::WasmModule};
2
3///
4/// WasmOps
5/// Thin ops-layer wrapper around the embedded WasmRegistry.
6///
7
8pub struct WasmOps;
9
10impl WasmOps {
11    #[must_use]
12    pub fn get(role: &CanisterRole) -> Option<WasmModule> {
13        WasmRegistry::get(role)
14    }
15
16    pub fn try_get(role: &CanisterRole) -> Result<WasmModule, Error> {
17        WasmRegistry::try_get(role)
18    }
19
20    pub fn import_static(wasms: &'static [(CanisterRole, &[u8])]) {
21        WasmRegistry::import(wasms);
22    }
23}