/// Compiles the given Wasm binary and registers it under the given id.
/// The function may fail if the Wasm binary is invalid.
Compiles the given Wasm binary and registers it under the given id.
The function may fail if the Wasm binary is invalid.
Compiles the given Wasm binary and registers it under the given id . The function may fail if the Wasm binary is invalid .
pub fn open_wasm(&self, wasm_id: WasmId, wasm_src: Vec<u8>) -> HypervisorResult<()> {
        let mut guard = self.repr.lock().unwrap();
        assert!(
            !guard.canister_wasms.contains_key(&wasm_id),
            "Failed to open wasm session {}: id is already in use",
            wasm_id,
        );
        let wasm = CanisterWasm::compile(&self.config, wasm_src)?;
        guard.canister_wasms.insert(wasm_id, Arc::new(wasm));
        Ok(())
    }
pub fn open_wasm ( & self , wasm_id : WasmId , wasm_src : Vec < u8 > ) -> HypervisorResult < ( ) > { let mut guard = self . repr . lock ( ) . unwrap ( ) ; assert ! ( guard canister_wasms contains_key ( wasm_id ) " " wasm_id ) ; let wasm = CanisterWasm :: compile ( & self . config , wasm_src ) ? ; guard . canister_wasms . insert ( wasm_id , Arc :: new ( wasm ) ) ; Ok ( ( ) ) }
Compiles the given Wasm binary and registers it under the given id.
Compiles the given Wasm binary and registers it under the given id .
&self
wasm_id
WasmId
wasm_src
Vec<u8>